libmicrohttpd

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

commit e91e6d3a372d918ca9b611221471cf6b5e37989b
parent 312fc9f812932fddf159006784e61d4536751214
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 12 May 2011 12:42:46 +0000

bugfix by hzm

Diffstat:
MAUTHORS | 1+
MChangeLog | 8++++++++
Msrc/daemon/connection.c | 10+++++++++-
3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/AUTHORS b/AUTHORS @@ -31,6 +31,7 @@ Erik Slagter <erik@slagter.name> Andreas Wehrmann <a.wehrmann@centersystems.com> Eivind Sarto <ivan@espial.com> Thomas Stalder <gnunet@netsolux.ch> +Zhimin Huang <zhimin.huang@bqvision.com> Documentation contributions also came from: Marco Maggi <marco.maggi-ipsu@poste.it> diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,11 @@ +Thu May 12 14:40:46 CEST 2011 + Fixed bug where if multiple HTTP request messages are piped in at once, + microhttpd would call the handler with the wrong upload_data_size. -HZM + +Thu May 12 14:40:08 CEST 2011 + Documented possible issue with off_t being sometimes + 32-bit and sometimes 64-bit depending on #includes. -CG + Sun May 8 21:52:47 CEST 2011 Allow MHD_SIZE_UNKNOWN to be used in conjunction with MHD_create_response_from_fd (fixing #1679). -TG diff --git a/src/daemon/connection.c b/src/daemon/connection.c @@ -1364,7 +1364,15 @@ process_request_body (struct MHD_Connection *connection) else { /* no chunked encoding, give all to the client */ - processed = available; + if ( (0 != connection->remaining_upload_size) && + (MHD_SIZE_UNKNOWN != connection->remaining_upload_size) ) + { + processed = connection->remaining_upload_size; + } + else + { + processed = available; + } } used = processed; connection->client_aware = MHD_YES;