commit 0bc2fe6fe7442c4d15498e6867a1e58697e809c9
parent 7aa69301bd05b05c798d887ff62edbe09db75e40
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 21 Mar 2017 14:23:23 +0100
add -lrt for glib
Diffstat:
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -1415,10 +1415,11 @@ 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))
+ if ( (MHD_YES != try_grow_read_buffer (connection)) &&
+ (0 != (connection->daemon->options &
+ MHD_USE_INTERNAL_POLLING_THREAD)) &&
+ (! connection->suspended) &&
+ (! connection->just_resumed) )
{
/* failed to grow the read buffer, and the
client which is supposed to handle the
@@ -1822,6 +1823,7 @@ 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,
@@ -1984,6 +1986,7 @@ 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,7 +2799,18 @@ 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,6 +947,12 @@ 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;
};