aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-12-19 00:06:48 +0100
committerChristian Grothoff <christian@grothoff.org>2018-12-19 00:06:48 +0100
commitb7052c04159e2d04482328f518dafc27e358cc65 (patch)
tree2ec25721ef82221f0454ebdf43dc23d5f3884fe5 /src/microhttpd/daemon.c
parent700f23d5d7153ce5de8617ac8d257828899d6f66 (diff)
downloadlibmicrohttpd-b7052c04159e2d04482328f518dafc27e358cc65.tar.gz
libmicrohttpd-b7052c04159e2d04482328f518dafc27e358cc65.zip
Check should (indeed) be for GNUTLS_E_AGAIN.
Lasa Martxel wrote: Hello, I have found the following code in daemon.c file, lines 1449 to 1467: if (0 >= res) { if (GNUTLS_E_INTERRUPTED != res) { urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY; if (GNUTLS_E_INTERRUPTED != res) (GNUTLS_E_INTERRUPTED != res) is checked twice. In the read part (a few lines above), GNUTLS_E_INTERRUPTED != res is checked first and then GNUTLS_E_AGAIN != res. It looks like something similar should be done here, but I’m not sure. Thanks, Martxel
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index ea12a532..4fc5b1b6 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1451,7 +1451,7 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
1451 if (GNUTLS_E_INTERRUPTED != res) 1451 if (GNUTLS_E_INTERRUPTED != res)
1452 { 1452 {
1453 urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY; 1453 urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;
1454 if (GNUTLS_E_INTERRUPTED != res) 1454 if (GNUTLS_E_AGAIN != res)
1455 { 1455 {
1456 /* TLS connection shut down or 1456 /* TLS connection shut down or
1457 * persistent / unrecoverable error. */ 1457 * persistent / unrecoverable error. */
@@ -2740,7 +2740,7 @@ internal_suspend_connection_ (struct MHD_Connection *connection)
2740 connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED; 2740 connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED;
2741 } 2741 }
2742#endif 2742#endif
2743#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 2743#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
2744 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); 2744 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
2745#endif 2745#endif
2746} 2746}
@@ -2949,7 +2949,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
2949 } 2949 }
2950#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 2950#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
2951 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); 2951 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
2952#endif 2952#endif
2953 if ( (used_thr_p_c) && 2953 if ( (used_thr_p_c) &&
2954 (MHD_NO != ret) ) 2954 (MHD_NO != ret) )
2955 { /* Wake up suspended connections. */ 2955 { /* Wake up suspended connections. */
@@ -3121,7 +3121,7 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
3121 } 3121 }
3122 else 3122 else
3123 { 3123 {
3124#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 3124#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
3125 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); 3125 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
3126#endif 3126#endif
3127 daemon->at_limit = true; 3127 daemon->at_limit = true;
@@ -4640,7 +4640,7 @@ unescape_wrapper (void *cls,
4640 char *val) 4640 char *val)
4641{ 4641{
4642 (void) cls; /* Mute compiler warning. */ 4642 (void) cls; /* Mute compiler warning. */
4643 4643
4644 (void) connection; /* Mute compiler warning. */ 4644 (void) connection; /* Mute compiler warning. */
4645 return MHD_http_unescape (val); 4645 return MHD_http_unescape (val);
4646} 4646}
@@ -4731,7 +4731,7 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
4731#endif 4731#endif
4732 return MHD_INVALID_SOCKET; 4732 return MHD_INVALID_SOCKET;
4733 } 4733 }
4734 4734
4735#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 4735#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
4736 if (NULL != daemon->worker_pool) 4736 if (NULL != daemon->worker_pool)
4737 for (i = 0; i < daemon->worker_pool_size; i++) 4737 for (i = 0; i < daemon->worker_pool_size; i++)
@@ -6091,7 +6091,7 @@ MHD_start_daemon_va (unsigned int flags,
6091 MHD_socket_last_strerr_()); 6091 MHD_socket_last_strerr_());
6092#endif 6092#endif
6093 if (0 != (*pflags & MHD_USE_EPOLL) 6093 if (0 != (*pflags & MHD_USE_EPOLL)
6094#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 6094#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
6095 || (daemon->worker_pool_size > 0) 6095 || (daemon->worker_pool_size > 0)
6096#endif 6096#endif
6097 ) 6097 )
@@ -6555,7 +6555,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
6555#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 6555#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
6556 unsigned int i; 6556 unsigned int i;
6557#endif 6557#endif
6558 6558
6559 if (NULL == daemon) 6559 if (NULL == daemon)
6560 return; 6560 return;
6561 6561