[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 01/02: Fixed connection states processing e
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 01/02: Fixed connection states processing error introduced by 813fc203ef95f7e3b1d410e182d363a30f5fdad3 |
Date: |
Sat, 25 Feb 2017 19:24:56 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 5398d8ba644dab2a5a24efaef9de7c9bc4b7e431
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sat Feb 25 21:21:52 2017 +0300
Fixed connection states processing error introduced by
813fc203ef95f7e3b1d410e182d363a30f5fdad3
---
src/microhttpd/daemon.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index f983e916..4a75b189 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -886,6 +886,7 @@ call_handlers (struct MHD_Connection *con,
bool force_close)
{
int ret;
+ bool states_info_processed = false;
/* Fast track flag */
bool on_fasttrack = (con->state == MHD_CONNECTION_INIT);
@@ -899,6 +900,7 @@ call_handlers (struct MHD_Connection *con,
{
con->read_handler (con);
ret = con->idle_handler (con);
+ states_info_processed = true;
}
/* No need to check value of 'ret' here as closed connection
* cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
@@ -906,6 +908,7 @@ call_handlers (struct MHD_Connection *con,
{
con->write_handler (con);
ret = con->idle_handler (con);
+ states_info_processed = true;
}
}
else
@@ -915,6 +918,11 @@ call_handlers (struct MHD_Connection *con,
return con->idle_handler (con);
}
+ if (!states_info_processed)
+ { /* Connection is not read or write ready, but external conditions
+ * may be changed and need to be processed. */
+ ret = con->idle_handler (con);
+ }
/* Fast track for fast connections. */
/* If full request was read by single read_handler() invocation
and headers were completely prepared by single idle_handler()
@@ -925,7 +933,7 @@ call_handlers (struct MHD_Connection *con,
only for non-blocking sockets. */
/* No need to check 'ret' as connection is always in
* MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */
- if (on_fasttrack && con->sk_nonblck)
+ else if (on_fasttrack && con->sk_nonblck)
{
if (MHD_CONNECTION_HEADERS_SENDING == con->state)
{
--
To stop receiving notification emails like this one, please contact
address@hidden