aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 55bd363c..0c59496a 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1535,6 +1535,7 @@ MHD_suspend_connection (struct MHD_Connection *connection)
1535 EDLL_remove (daemon->eready_head, 1535 EDLL_remove (daemon->eready_head,
1536 daemon->eready_tail, 1536 daemon->eready_tail,
1537 connection); 1537 connection);
1538 connection->epoll_state &= ~MHD_EPOLL_STATE_IN_EREADY_EDLL;
1538 } 1539 }
1539 if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET)) 1540 if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EPOLL_SET))
1540 { 1541 {
@@ -1633,25 +1634,13 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
1633 if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) 1634 if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
1634 { 1635 {
1635 if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL)) 1636 if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
1636 { 1637 MHD_PANIC ("Resumed connection was already in EREADY set\n");
1637 EDLL_insert (daemon->eready_head, 1638 /* we always mark resumed connections as ready, as we
1638 daemon->eready_tail, 1639 might have missed the edge poll event during suspension */
1639 pos); 1640 EDLL_insert (daemon->eready_head,
1640 } 1641 daemon->eready_tail,
1641 else 1642 pos);
1642 { 1643 pos->epoll_state |= MHD_EPOLL_STATE_IN_EREADY_EDLL;
1643 struct epoll_event event;
1644
1645 event.events = EPOLLIN | EPOLLOUT | EPOLLET;
1646 event.data.ptr = pos;
1647 if (0 != epoll_ctl (daemon->epoll_fd,
1648 EPOLL_CTL_ADD,
1649 pos->socket_fd,
1650 &event))
1651 MHD_PANIC ("Failed to add FD to epoll set\n");
1652 else
1653 pos->epoll_state |= MHD_EPOLL_STATE_IN_EPOLL_SET;
1654 }
1655 pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED; 1644 pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
1656 } 1645 }
1657#endif 1646#endif
@@ -2981,7 +2970,7 @@ parse_options_va (struct MHD_Daemon *daemon,
2981 case MHD_OPTION_HTTPS_MEM_DHPARAMS: 2970 case MHD_OPTION_HTTPS_MEM_DHPARAMS:
2982 if (0 != (daemon->options & MHD_USE_SSL)) 2971 if (0 != (daemon->options & MHD_USE_SSL))
2983 { 2972 {
2984 const char *arg = va_arg (ap, const unsigned char *); 2973 const char *arg = va_arg (ap, const char *);
2985 gnutls_datum_t dhpar; 2974 gnutls_datum_t dhpar;
2986 2975
2987 if (gnutls_dh_params_init (&daemon->https_mem_dhparams) < 0) 2976 if (gnutls_dh_params_init (&daemon->https_mem_dhparams) < 0)