libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit cde3691e85724707c55d776fad3e93454eaf24d1
parent 5c51824265c97a596aa840025106b061766a2b62
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 29 Oct 2014 15:53:17 +0000

handle bogus return value from send() call

Diffstat:
Msrc/microhttpd/daemon.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -1037,6 +1037,11 @@ send_param_adapter (struct MHD_Connection *connection, connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; } #endif + /* Handle broken kernel / libc, returning -1 but not setting errno; + kill connection as that should be safe; reported on mailinglist here: + http://lists.gnu.org/archive/html/libmicrohttpd/2014-10/msg00023.html */ + if ( (-1 == ret) && (0 == errno) ) + errno = ECONNRESET; return ret; }