paullouisageneau / libplum

Multi-protocol Port Mapping client library
Mozilla Public License 2.0
40 stars 5 forks source link

http: propagate tcp timeout errors #30

Closed oviano closed 2 months ago

oviano commented 2 months ago

This PR defines two error codes for tcp_send/recv according to whether the error was a timeout or another error. This is used to fill in a new timed_out flag in the http response structure. Finally this is checked by the upnp protocol code to return PROTOCOL_ERR_TIMEOUT if necessary.

This means that if a protocol fails to complete successfully due to a TCP timeout it will be retried under the same system that is used for timing out waiting for broadcast responses.

oviano commented 2 months ago

That's fair enough, I'm not sure why I did it like that, come to think of it!

Will fix it up in a bit.