libmicrohttpd

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

commit e9c09cf9ae459c04bc9aa029f3e376e241afb16e
parent 45a1764cb8ae079e6376f800f6868a3efdd0f9b9
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 19 Jul 2019 19:43:04 +0200

fix err logic

Diffstat:
Msrc/microhttpd/mhd_send.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c @@ -82,12 +82,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, bool using_tls = false; /* The socket. */ MHD_socket s = connection->socket_fd; - int eno; ssize_t ret; - int optval; const MHD_SCKT_OPT_BOOL_ off_val = 0; const MHD_SCKT_OPT_BOOL_ on_val = 1; - const int err = MHD_socket_get_error_ (); /* error handling from send_param_adapter() */ if ((MHD_INVALID_SOCKET == s) || (MHD_CONNECTION_CLOSED == connection->state)) @@ -244,6 +241,8 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, if (0 > ret) { + const int err = MHD_socket_get_error_ (); + if (MHD_SCKT_ERR_IS_EAGAIN_ (err)) { #if EPOLL_SUPPORT @@ -321,8 +320,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, if (!have_more_data && corked) gnutls_record_uncork(connection->tls_session); */ - - errno = eno; return ret; }