aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index d90bbcf0..d9d88ec1 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -401,7 +401,9 @@ recv_tls_adapter (struct MHD_Connection *connection, void *other, size_t i)
401 (GNUTLS_E_INTERRUPTED == res) ) 401 (GNUTLS_E_INTERRUPTED == res) )
402 { 402 {
403 errno = EINTR; 403 errno = EINTR;
404#if EPOLL_SUPPORT
404 connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY; 405 connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
406#endif
405 return -1; 407 return -1;
406 } 408 }
407 if (res < 0) 409 if (res < 0)
@@ -441,7 +443,9 @@ send_tls_adapter (struct MHD_Connection *connection,
441 { 443 {
442 fprintf (stderr, "WAGAIN!\n"); 444 fprintf (stderr, "WAGAIN!\n");
443 errno = EINTR; 445 errno = EINTR;
446#if EPOLL_SUPPORT
444 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; 447 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
448#endif
445 return -1; 449 return -1;
446 } 450 }
447 return res; 451 return res;
@@ -3344,8 +3348,10 @@ thread_failed:
3344 free_and_fail: 3348 free_and_fail:
3345 /* clean up basic memory state in 'daemon' and return NULL to 3349 /* clean up basic memory state in 'daemon' and return NULL to
3346 indicate failure */ 3350 indicate failure */
3351#if EPOLL_SUPPORT
3347 if (-1 != daemon->epoll_fd) 3352 if (-1 != daemon->epoll_fd)
3348 close (daemon->epoll_fd); 3353 close (daemon->epoll_fd);
3354#endif
3349#ifdef DAUTH_SUPPORT 3355#ifdef DAUTH_SUPPORT
3350 free (daemon->nnc); 3356 free (daemon->nnc);
3351 pthread_mutex_destroy (&daemon->nnc_lock); 3357 pthread_mutex_destroy (&daemon->nnc_lock);
@@ -3532,9 +3538,11 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
3532 MHD_PANIC ("Failed to join a thread\n"); 3538 MHD_PANIC ("Failed to join a thread\n");
3533 close_all_connections (&daemon->worker_pool[i]); 3539 close_all_connections (&daemon->worker_pool[i]);
3534 pthread_mutex_destroy (&daemon->worker_pool[i].cleanup_connection_mutex); 3540 pthread_mutex_destroy (&daemon->worker_pool[i].cleanup_connection_mutex);
3541#if EPOLL_SUPPORT
3535 if ( (-1 != daemon->worker_pool[i].epoll_fd) && 3542 if ( (-1 != daemon->worker_pool[i].epoll_fd) &&
3536 (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) ) 3543 (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) )
3537 MHD_PANIC ("close failed\n"); 3544 MHD_PANIC ("close failed\n");
3545#endif
3538 } 3546 }
3539 free (daemon->worker_pool); 3547 free (daemon->worker_pool);
3540 } 3548 }