diff options
Diffstat (limited to 'src/lib/action_suspend.c')
-rw-r--r-- | src/lib/action_suspend.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/lib/action_suspend.c b/src/lib/action_suspend.c index bf5adc34..c176e494 100644 --- a/src/lib/action_suspend.c +++ b/src/lib/action_suspend.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | static enum MHD_StatusCode | 36 | static enum MHD_StatusCode |
37 | suspend_action (void *cls, | 37 | suspend_action (void *cls, |
38 | struct MHD_Request *request) | 38 | struct MHD_Request *request) |
39 | { | 39 | { |
40 | (void) cls; | 40 | (void) cls; |
41 | struct MHD_Connection *connection = request->connection; | 41 | struct MHD_Connection *connection = request->connection; |
@@ -43,24 +43,24 @@ suspend_action (void *cls, | |||
43 | 43 | ||
44 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 44 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
45 | if (connection->resuming) | 45 | if (connection->resuming) |
46 | { | 46 | { |
47 | /* suspending again while we didn't even complete resuming yet */ | 47 | /* suspending again while we didn't even complete resuming yet */ |
48 | connection->resuming = false; | 48 | connection->resuming = false; |
49 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 49 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
50 | return MHD_SC_OK; | 50 | return MHD_SC_OK; |
51 | } | 51 | } |
52 | if (daemon->threading_mode != MHD_TM_THREAD_PER_CONNECTION) | 52 | if (daemon->threading_mode != MHD_TM_THREAD_PER_CONNECTION) |
53 | { | 53 | { |
54 | if (connection->connection_timeout == | 54 | if (connection->connection_timeout == |
55 | daemon->connection_default_timeout) | 55 | daemon->connection_default_timeout) |
56 | XDLL_remove (daemon->normal_timeout_head, | 56 | XDLL_remove (daemon->normal_timeout_head, |
57 | daemon->normal_timeout_tail, | 57 | daemon->normal_timeout_tail, |
58 | connection); | 58 | connection); |
59 | else | 59 | else |
60 | XDLL_remove (daemon->manual_timeout_head, | 60 | XDLL_remove (daemon->manual_timeout_head, |
61 | daemon->manual_timeout_tail, | 61 | daemon->manual_timeout_tail, |
62 | connection); | 62 | connection); |
63 | } | 63 | } |
64 | DLL_remove (daemon->connections_head, | 64 | DLL_remove (daemon->connections_head, |
65 | daemon->connections_tail, | 65 | daemon->connections_tail, |
66 | connection); | 66 | connection); |
@@ -71,25 +71,25 @@ suspend_action (void *cls, | |||
71 | connection->suspended = true; | 71 | connection->suspended = true; |
72 | #ifdef EPOLL_SUPPORT | 72 | #ifdef EPOLL_SUPPORT |
73 | if (MHD_ELS_EPOLL == daemon->event_loop_syscall) | 73 | if (MHD_ELS_EPOLL == daemon->event_loop_syscall) |
74 | { | ||
75 | if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) | ||
76 | { | ||
77 | EDLL_remove (daemon->eready_head, | ||
78 | daemon->eready_tail, | ||
79 | connection); | ||
80 | connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL; | ||
81 | } | ||
82 | if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) | ||
74 | { | 83 | { |
75 | if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) | 84 | if (0 != epoll_ctl (daemon->epoll_fd, |
76 | { | 85 | EPOLL_CTL_DEL, |
77 | EDLL_remove (daemon->eready_head, | 86 | connection->socket_fd, |
78 | daemon->eready_tail, | 87 | NULL)) |
79 | connection); | 88 | MHD_PANIC (_ ("Failed to remove FD from epoll set\n")); |
80 | connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL; | 89 | connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET; |
81 | } | ||
82 | if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) | ||
83 | { | ||
84 | if (0 != epoll_ctl (daemon->epoll_fd, | ||
85 | EPOLL_CTL_DEL, | ||
86 | connection->socket_fd, | ||
87 | NULL)) | ||
88 | MHD_PANIC (_("Failed to remove FD from epoll set\n")); | ||
89 | connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EPOLL_SET; | ||
90 | } | ||
91 | connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED; | ||
92 | } | 90 | } |
91 | connection->epoll_state |= MHD_EPOLL_STATE_SUSPENDED; | ||
92 | } | ||
93 | #endif | 93 | #endif |
94 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 94 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
95 | return MHD_SC_OK; | 95 | return MHD_SC_OK; |