Fix blocking close with LWIP_SO_SNDTIMEO

This fixes a bug in close when LWIP_SO_SNDTIMEO is enabled, but
the option is not in use on the socket

A simple mis-typed comparison against zero would cause the close_timeout
to get set to zero if conn->send_timeout was 0

The intended check was to over-ride the default close timeout if a
send timeout had been specified via SO_SNDTIMEO
This commit is contained in:
Joel Cunningham 2015-12-17 09:57:12 -06:00 committed by Dirk Ziegelmeier
parent 70487a43d4
commit 11faa8149e

View File

@ -886,7 +886,7 @@ lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM)
/* this is kind of an lwip addition to the standard sockets: we wait
for some time when failing to allocate a segment for the FIN */
#if LWIP_SO_SNDTIMEO
if (conn->send_timeout >= 0) {
if (conn->send_timeout > 0) {
close_timeout = conn->send_timeout;
}
#endif /* LWIP_SO_SNDTIMEO */