commit cdcc0126c6ee4e7b9265a9df95f1f9f87367c324
parent 7e1123665e5a7df29649f632e978d7ee1016ff25
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 22 Mar 2017 23:15:34 +0300
Revert commit 0bc2fe6fe7442c4d15498e6867a1e58697e809c9.
Connection moved to the end of timeout list in resume_suspended_connections(),
moreover suspended connections are not in DL-list (XDLL_remove may break something) and
timeout DL-list is not maintained in thread-per-connection mode
No need to use 'just_resumed': if connection is suspended again in first DH function,
MHD_connection_update_event_loop_info will be called with 'suspended' flag set.
Diffstat:
3 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -1415,11 +1415,10 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection)
case MHD_CONNECTION_CONTINUE_SENT:
if (connection->read_buffer_offset == connection->read_buffer_size)
{
- if ( (MHD_YES != try_grow_read_buffer (connection)) &&
- (0 != (connection->daemon->options &
- MHD_USE_INTERNAL_POLLING_THREAD)) &&
- (! connection->suspended) &&
- (! connection->just_resumed) )
+ if ((MHD_YES != try_grow_read_buffer (connection)) &&
+ (0 != (connection->daemon->options &
+ MHD_USE_INTERNAL_POLLING_THREAD)) &&
+ (! connection->suspended))
{
/* failed to grow the read buffer, and the
client which is supposed to handle the
@@ -1823,7 +1822,6 @@ call_connection_handler (struct MHD_Connection *connection)
return; /* already queued a response */
processed = 0;
connection->client_aware = true;
- connection->just_resumed = false;
if (MHD_NO ==
connection->daemon->default_handler (connection->daemon-> default_handler_cls,
connection,
@@ -1986,7 +1984,6 @@ process_request_body (struct MHD_Connection *connection)
}
used = processed;
connection->client_aware = true;
- connection->just_resumed = false;
if (MHD_NO ==
connection->daemon->default_handler (connection->daemon->default_handler_cls,
connection,
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2799,18 +2799,7 @@ MHD_resume_connection (struct MHD_Connection *connection)
MHD_PANIC (_("Cannot resume connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n"));
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
connection->resuming = true;
- connection->just_resumed = true;
daemon->resuming = true;
- if (connection->connection_timeout == daemon->connection_timeout)
- {
- /* move to the end... */
- XDLL_remove (daemon->normal_timeout_head,
- daemon->normal_timeout_tail,
- connection);
- XDLL_insert (daemon->normal_timeout_head,
- daemon->normal_timeout_tail,
- connection);
- }
MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
(! MHD_itc_activate_ (daemon->itc, "r")) )
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
@@ -947,12 +947,6 @@ struct MHD_Connection
* Is the connection wanting to resume?
*/
bool resuming;
-
- /**
- * Did the connection just resume? (Means we are generous
- * in dealing with a full read buffer...).
- */
- bool just_resumed;
};