libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 14a00658694de3dea1188096fdc06395e14e3ee3
parent 51da5739fef39eadaadac9a35b94819ee820fd86
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 17 May 2014 04:47:33 +0000

never notify twice

Diffstat:
MChangeLog | 4++++
Msrc/microhttpd/connection.c | 6+++++-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Sat May 17 06:47:00 CEST 2014 + Fix notifying client about completed request twice + under certain circumstances. -CG + Tue May 13 18:24:37 CEST 2014 Fix accidental transmission of footer termination '\r\n' for responses with zero byte payload and non-chunked diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -2535,11 +2535,15 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) MHD_HTTP_HEADER_CONNECTION); MHD_destroy_response (connection->response); connection->response = NULL; - if (NULL != daemon->notify_completed) + if ( (NULL != daemon->notify_completed) && + (MHD_YES == connection->client_aware) ) + { daemon->notify_completed (daemon->notify_completed_cls, connection, &connection->client_context, MHD_REQUEST_TERMINATED_COMPLETED_OK); + connection->client_aware = MHD_NO; + } end = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_CONNECTION);