aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-07-19 19:43:04 +0200
committerChristian Grothoff <christian@grothoff.org>2019-07-19 19:43:04 +0200
commite9c09cf9ae459c04bc9aa029f3e376e241afb16e (patch)
treed668de52aa90e04f66168210cf3875863a4fc2e2 /src/microhttpd/mhd_send.c
parent45a1764cb8ae079e6376f800f6868a3efdd0f9b9 (diff)
downloadlibmicrohttpd-e9c09cf9ae459c04bc9aa029f3e376e241afb16e.tar.gz
libmicrohttpd-e9c09cf9ae459c04bc9aa029f3e376e241afb16e.zip
fix err logic
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-rw-r--r--src/microhttpd/mhd_send.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 220ca0f3..cd5b9ad5 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -82,12 +82,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
82 bool using_tls = false; 82 bool using_tls = false;
83 /* The socket. */ 83 /* The socket. */
84 MHD_socket s = connection->socket_fd; 84 MHD_socket s = connection->socket_fd;
85 int eno;
86 ssize_t ret; 85 ssize_t ret;
87 int optval;
88 const MHD_SCKT_OPT_BOOL_ off_val = 0; 86 const MHD_SCKT_OPT_BOOL_ off_val = 0;
89 const MHD_SCKT_OPT_BOOL_ on_val = 1; 87 const MHD_SCKT_OPT_BOOL_ on_val = 1;
90 const int err = MHD_socket_get_error_ ();
91 88
92 /* error handling from send_param_adapter() */ 89 /* error handling from send_param_adapter() */
93 if ((MHD_INVALID_SOCKET == s) || (MHD_CONNECTION_CLOSED == connection->state)) 90 if ((MHD_INVALID_SOCKET == s) || (MHD_CONNECTION_CLOSED == connection->state))
@@ -244,6 +241,8 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
244 241
245 if (0 > ret) 242 if (0 > ret)
246 { 243 {
244 const int err = MHD_socket_get_error_ ();
245
247 if (MHD_SCKT_ERR_IS_EAGAIN_ (err)) 246 if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
248 { 247 {
249#if EPOLL_SUPPORT 248#if EPOLL_SUPPORT
@@ -321,8 +320,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
321 if (!have_more_data && corked) 320 if (!have_more_data && corked)
322 gnutls_record_uncork(connection->tls_session); 321 gnutls_record_uncork(connection->tls_session);
323 */ 322 */
324
325 errno = eno;
326 return ret; 323 return ret;
327} 324}
328 325