diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/connection.c | 11 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 11 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 6 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 5271991f..695a605c 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1415,10 +1415,11 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1415 | case MHD_CONNECTION_CONTINUE_SENT: | 1415 | case MHD_CONNECTION_CONTINUE_SENT: |
1416 | if (connection->read_buffer_offset == connection->read_buffer_size) | 1416 | if (connection->read_buffer_offset == connection->read_buffer_size) |
1417 | { | 1417 | { |
1418 | if ((MHD_YES != try_grow_read_buffer (connection)) && | 1418 | if ( (MHD_YES != try_grow_read_buffer (connection)) && |
1419 | (0 != (connection->daemon->options & | 1419 | (0 != (connection->daemon->options & |
1420 | MHD_USE_INTERNAL_POLLING_THREAD)) && | 1420 | MHD_USE_INTERNAL_POLLING_THREAD)) && |
1421 | (! connection->suspended)) | 1421 | (! connection->suspended) && |
1422 | (! connection->just_resumed) ) | ||
1422 | { | 1423 | { |
1423 | /* failed to grow the read buffer, and the | 1424 | /* failed to grow the read buffer, and the |
1424 | client which is supposed to handle the | 1425 | client which is supposed to handle the |
@@ -1822,6 +1823,7 @@ call_connection_handler (struct MHD_Connection *connection) | |||
1822 | return; /* already queued a response */ | 1823 | return; /* already queued a response */ |
1823 | processed = 0; | 1824 | processed = 0; |
1824 | connection->client_aware = true; | 1825 | connection->client_aware = true; |
1826 | connection->just_resumed = false; | ||
1825 | if (MHD_NO == | 1827 | if (MHD_NO == |
1826 | connection->daemon->default_handler (connection->daemon-> default_handler_cls, | 1828 | connection->daemon->default_handler (connection->daemon-> default_handler_cls, |
1827 | connection, | 1829 | connection, |
@@ -1984,6 +1986,7 @@ process_request_body (struct MHD_Connection *connection) | |||
1984 | } | 1986 | } |
1985 | used = processed; | 1987 | used = processed; |
1986 | connection->client_aware = true; | 1988 | connection->client_aware = true; |
1989 | connection->just_resumed = false; | ||
1987 | if (MHD_NO == | 1990 | if (MHD_NO == |
1988 | connection->daemon->default_handler (connection->daemon->default_handler_cls, | 1991 | connection->daemon->default_handler (connection->daemon->default_handler_cls, |
1989 | connection, | 1992 | connection, |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index d1ec032a..e94ad64c 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2799,7 +2799,18 @@ MHD_resume_connection (struct MHD_Connection *connection) | |||
2799 | MHD_PANIC (_("Cannot resume connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n")); | 2799 | MHD_PANIC (_("Cannot resume connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n")); |
2800 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 2800 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
2801 | connection->resuming = true; | 2801 | connection->resuming = true; |
2802 | connection->just_resumed = true; | ||
2802 | daemon->resuming = true; | 2803 | daemon->resuming = true; |
2804 | if (connection->connection_timeout == daemon->connection_timeout) | ||
2805 | { | ||
2806 | /* move to the end... */ | ||
2807 | XDLL_remove (daemon->normal_timeout_head, | ||
2808 | daemon->normal_timeout_tail, | ||
2809 | connection); | ||
2810 | XDLL_insert (daemon->normal_timeout_head, | ||
2811 | daemon->normal_timeout_tail, | ||
2812 | connection); | ||
2813 | } | ||
2803 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 2814 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
2804 | if ( (MHD_ITC_IS_VALID_(daemon->itc)) && | 2815 | if ( (MHD_ITC_IS_VALID_(daemon->itc)) && |
2805 | (! MHD_itc_activate_ (daemon->itc, "r")) ) | 2816 | (! MHD_itc_activate_ (daemon->itc, "r")) ) |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 5350c013..3abd9731 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -947,6 +947,12 @@ struct MHD_Connection | |||
947 | * Is the connection wanting to resume? | 947 | * Is the connection wanting to resume? |
948 | */ | 948 | */ |
949 | bool resuming; | 949 | bool resuming; |
950 | |||
951 | /** | ||
952 | * Did the connection just resume? (Means we are generous | ||
953 | * in dealing with a full read buffer...). | ||
954 | */ | ||
955 | bool just_resumed; | ||
950 | }; | 956 | }; |
951 | 957 | ||
952 | 958 | ||