commit 9bba474f7ba716ec546cc9740148562447f7d267
parent 69b9aa6513f6a0a83e2216f4caea586296ccb905
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 10 Jun 2016 00:23:30 +0000
-do not call callback if connection was already suspended
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -2542,6 +2542,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
if (MHD_CONNECTION_CLOSED == connection->state)
continue;
connection->state = MHD_CONNECTION_HEADERS_PROCESSED;
+ if (MHD_YES == connection->suspended)
+ break;
continue;
case MHD_CONNECTION_HEADERS_PROCESSED:
call_connection_handler (connection); /* first call */
@@ -2570,6 +2572,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
}
connection->state = (0 == connection->remaining_upload_size)
? MHD_CONNECTION_FOOTERS_RECEIVED : MHD_CONNECTION_CONTINUE_SENT;
+ if (MHD_YES == connection->suspended)
+ break;
continue;
case MHD_CONNECTION_CONTINUE_SENDING:
if (connection->continue_message_write_offset ==
@@ -2601,6 +2605,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
connection->state = MHD_CONNECTION_BODY_RECEIVED;
else
connection->state = MHD_CONNECTION_FOOTERS_RECEIVED;
+ if (MHD_YES == connection->suspended)
+ break;
continue;
}
break;
@@ -2621,6 +2627,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
if (0 == line[0])
{
connection->state = MHD_CONNECTION_FOOTERS_RECEIVED;
+ if (MHD_YES == connection->suspended)
+ break;
continue;
}
if (MHD_NO == process_header_line (connection, line))
@@ -2652,6 +2660,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
if (0 == line[0])
{
connection->state = MHD_CONNECTION_FOOTERS_RECEIVED;
+ if (MHD_YES == connection->suspended)
+ break;
continue;
}
continue;