libmicrohttpd

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

commit 184cbd62227272a9b89f5acf5373f31fa01e8a96
parent d618f1d7bc2e9754458e397ba29fd6cbeb4dd387
Author: Andrey Uzunov <andrey.uzunov@gmail.com>
Date:   Sun, 21 Jul 2013 16:05:48 +0000

microhttpd: put "#if EPOLL_SUPPORT" everywhere, so compilation can succeed even when it is disabled

Diffstat:
Msrc/microhttpd/connection.c | 2+-
Msrc/microhttpd/connection_https.c | 4++++
Msrc/microhttpd/daemon.c | 8++++++++
3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -2435,6 +2435,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) return MHD_YES; } MHD_connection_update_event_loop_info (connection); +#if EPOLL_SUPPORT switch (connection->event_loop_info) { case MHD_EVENT_LOOP_INFO_READ: @@ -2472,7 +2473,6 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) /* This connection is finished, nothing left to do */ break; } -#if EPOLL_SUPPORT return MHD_connection_epoll_update_ (connection); #else return MHD_YES; diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c @@ -157,7 +157,11 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) return MHD_YES; return MHD_connection_handle_idle (connection); } +#if EPOLL_SUPPORT return MHD_connection_epoll_update_ (connection); +#else + return MHD_YES; +#endif } diff --git 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) (GNUTLS_E_INTERRUPTED == res) ) { errno = EINTR; +#if EPOLL_SUPPORT connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY; +#endif return -1; } if (res < 0) @@ -441,7 +443,9 @@ send_tls_adapter (struct MHD_Connection *connection, { fprintf (stderr, "WAGAIN!\n"); errno = EINTR; +#if EPOLL_SUPPORT connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; +#endif return -1; } return res; @@ -3344,8 +3348,10 @@ thread_failed: free_and_fail: /* clean up basic memory state in 'daemon' and return NULL to indicate failure */ +#if EPOLL_SUPPORT if (-1 != daemon->epoll_fd) close (daemon->epoll_fd); +#endif #ifdef DAUTH_SUPPORT free (daemon->nnc); pthread_mutex_destroy (&daemon->nnc_lock); @@ -3532,9 +3538,11 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) MHD_PANIC ("Failed to join a thread\n"); close_all_connections (&daemon->worker_pool[i]); pthread_mutex_destroy (&daemon->worker_pool[i].cleanup_connection_mutex); +#if EPOLL_SUPPORT if ( (-1 != daemon->worker_pool[i].epoll_fd) && (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) ) MHD_PANIC ("close failed\n"); +#endif } free (daemon->worker_pool); }