aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Uzunov <andrey.uzunov@gmail.com>2013-07-21 16:05:48 +0000
committerAndrey Uzunov <andrey.uzunov@gmail.com>2013-07-21 16:05:48 +0000
commit184cbd62227272a9b89f5acf5373f31fa01e8a96 (patch)
treef201651a8b80aaf996873c54f7a9615861af255b
parentd618f1d7bc2e9754458e397ba29fd6cbeb4dd387 (diff)
downloadlibmicrohttpd-184cbd62227272a9b89f5acf5373f31fa01e8a96.tar.gz
libmicrohttpd-184cbd62227272a9b89f5acf5373f31fa01e8a96.zip
microhttpd: put "#if EPOLL_SUPPORT" everywhere, so compilation can succeed even when it is disabled
-rw-r--r--src/microhttpd/connection.c2
-rw-r--r--src/microhttpd/connection_https.c4
-rw-r--r--src/microhttpd/daemon.c8
3 files changed, 13 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 984c9247..cfe77edf 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2435,6 +2435,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2435 return MHD_YES; 2435 return MHD_YES;
2436 } 2436 }
2437 MHD_connection_update_event_loop_info (connection); 2437 MHD_connection_update_event_loop_info (connection);
2438#if EPOLL_SUPPORT
2438 switch (connection->event_loop_info) 2439 switch (connection->event_loop_info)
2439 { 2440 {
2440 case MHD_EVENT_LOOP_INFO_READ: 2441 case MHD_EVENT_LOOP_INFO_READ:
@@ -2472,7 +2473,6 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2472 /* This connection is finished, nothing left to do */ 2473 /* This connection is finished, nothing left to do */
2473 break; 2474 break;
2474 } 2475 }
2475#if EPOLL_SUPPORT
2476 return MHD_connection_epoll_update_ (connection); 2476 return MHD_connection_epoll_update_ (connection);
2477#else 2477#else
2478 return MHD_YES; 2478 return MHD_YES;
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c
index 0b764eb7..4f49d513 100644
--- 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)
157 return MHD_YES; 157 return MHD_YES;
158 return MHD_connection_handle_idle (connection); 158 return MHD_connection_handle_idle (connection);
159 } 159 }
160#if EPOLL_SUPPORT
160 return MHD_connection_epoll_update_ (connection); 161 return MHD_connection_epoll_update_ (connection);
162#else
163 return MHD_YES;
164#endif
161} 165}
162 166
163 167
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 }