diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 83 |
1 files changed, 43 insertions, 40 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 0a9f9885..dc224588 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -2709,7 +2709,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) connection->state = MHD_CONNECTION_NORMAL_BODY_READY; /* Buffering for flushable socket was already enabled*/ if (MHD_NO == socket_flush_possible (connection)) - socket_start_no_buffering (connection); + socket_start_no_buffering (connection); break; } @@ -2737,7 +2737,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) connection->state = MHD_CONNECTION_CHUNKED_BODY_READY; /* Buffering for flushable socket was already enabled */ if (MHD_NO == socket_flush_possible (connection)) - socket_start_no_buffering (connection); + socket_start_no_buffering (connection); continue; } @@ -2860,45 +2860,48 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) } MHD_connection_update_event_loop_info (connection); #if EPOLL_SUPPORT - switch (connection->event_loop_info) + if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) { - case MHD_EVENT_LOOP_INFO_READ: - if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) && - (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && - (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) - { - EDLL_insert (daemon->eready_head, - daemon->eready_tail, - connection); - connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; - } - break; - case MHD_EVENT_LOOP_INFO_WRITE: - if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) && - (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && - (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) - { - EDLL_insert (daemon->eready_head, - daemon->eready_tail, - connection); - connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; - } - break; - case MHD_EVENT_LOOP_INFO_BLOCK: - /* we should look at this connection again in the next iteration - of the event loop, as we're waiting on the application */ - if ( (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) && - (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED))) ) - { - EDLL_insert (daemon->eready_head, - daemon->eready_tail, - connection); - connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; - } - break; - case MHD_EVENT_LOOP_INFO_CLEANUP: - /* This connection is finished, nothing left to do */ - break; + switch (connection->event_loop_info) + { + case MHD_EVENT_LOOP_INFO_READ: + if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) && + (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && + (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) + { + EDLL_insert (daemon->eready_head, + daemon->eready_tail, + connection); + connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; + } + break; + case MHD_EVENT_LOOP_INFO_WRITE: + if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) && + (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && + (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) + { + EDLL_insert (daemon->eready_head, + daemon->eready_tail, + connection); + connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; + } + break; + case MHD_EVENT_LOOP_INFO_BLOCK: + /* we should look at this connection again in the next iteration + of the event loop, as we're waiting on the application */ + if ( (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) && + (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED))) ) + { + EDLL_insert (daemon->eready_head, + daemon->eready_tail, + connection); + connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; + } + break; + case MHD_EVENT_LOOP_INFO_CLEANUP: + /* This connection is finished, nothing left to do */ + break; + } } return MHD_connection_epoll_update_ (connection); #else |