aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c83
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)
2709 connection->state = MHD_CONNECTION_NORMAL_BODY_READY; 2709 connection->state = MHD_CONNECTION_NORMAL_BODY_READY;
2710 /* Buffering for flushable socket was already enabled*/ 2710 /* Buffering for flushable socket was already enabled*/
2711 if (MHD_NO == socket_flush_possible (connection)) 2711 if (MHD_NO == socket_flush_possible (connection))
2712 socket_start_no_buffering (connection); 2712 socket_start_no_buffering (connection);
2713 2713
2714 break; 2714 break;
2715 } 2715 }
@@ -2737,7 +2737,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2737 connection->state = MHD_CONNECTION_CHUNKED_BODY_READY; 2737 connection->state = MHD_CONNECTION_CHUNKED_BODY_READY;
2738 /* Buffering for flushable socket was already enabled */ 2738 /* Buffering for flushable socket was already enabled */
2739 if (MHD_NO == socket_flush_possible (connection)) 2739 if (MHD_NO == socket_flush_possible (connection))
2740 socket_start_no_buffering (connection); 2740 socket_start_no_buffering (connection);
2741 2741
2742 continue; 2742 continue;
2743 } 2743 }
@@ -2860,45 +2860,48 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2860 } 2860 }
2861 MHD_connection_update_event_loop_info (connection); 2861 MHD_connection_update_event_loop_info (connection);
2862#if EPOLL_SUPPORT 2862#if EPOLL_SUPPORT
2863 switch (connection->event_loop_info) 2863 if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
2864 { 2864 {
2865 case MHD_EVENT_LOOP_INFO_READ: 2865 switch (connection->event_loop_info)
2866 if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) && 2866 {
2867 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && 2867 case MHD_EVENT_LOOP_INFO_READ:
2868 (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) 2868 if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_READ_READY)) &&
2869 { 2869 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) &&
2870 EDLL_insert (daemon->eready_head, 2870 (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) )
2871 daemon->eready_tail, 2871 {
2872 connection); 2872 EDLL_insert (daemon->eready_head,
2873 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; 2873 daemon->eready_tail,
2874 } 2874 connection);
2875 break; 2875 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
2876 case MHD_EVENT_LOOP_INFO_WRITE: 2876 }
2877 if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) && 2877 break;
2878 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) && 2878 case MHD_EVENT_LOOP_INFO_WRITE:
2879 (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) ) 2879 if ( (0 != (connection->epoll_state & MHD_EPOLL_STATE_WRITE_READY)) &&
2880 { 2880 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED)) &&
2881 EDLL_insert (daemon->eready_head, 2881 (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) )
2882 daemon->eready_tail, 2882 {
2883 connection); 2883 EDLL_insert (daemon->eready_head,
2884 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; 2884 daemon->eready_tail,
2885 } 2885 connection);
2886 break; 2886 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
2887 case MHD_EVENT_LOOP_INFO_BLOCK: 2887 }
2888 /* we should look at this connection again in the next iteration 2888 break;
2889 of the event loop, as we're waiting on the application */ 2889 case MHD_EVENT_LOOP_INFO_BLOCK:
2890 if ( (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) && 2890 /* we should look at this connection again in the next iteration
2891 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED))) ) 2891 of the event loop, as we're waiting on the application */
2892 { 2892 if ( (0 == (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL) &&
2893 EDLL_insert (daemon->eready_head, 2893 (0 == (connection->epoll_state & MHD_EPOLL_STATE_SUSPENDED))) )
2894 daemon->eready_tail, 2894 {
2895 connection); 2895 EDLL_insert (daemon->eready_head,
2896 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL; 2896 daemon->eready_tail,
2897 } 2897 connection);
2898 break; 2898 connection->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
2899 case MHD_EVENT_LOOP_INFO_CLEANUP: 2899 }
2900 /* This connection is finished, nothing left to do */ 2900 break;
2901 break; 2901 case MHD_EVENT_LOOP_INFO_CLEANUP:
2902 /* This connection is finished, nothing left to do */
2903 break;
2904 }
2902 } 2905 }
2903 return MHD_connection_epoll_update_ (connection); 2906 return MHD_connection_epoll_update_ (connection);
2904#else 2907#else