diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-28 12:07:11 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-28 12:07:11 +0000 |
commit | d9ab40f53238b49c9f4a4df13e0262fbefb4a95a (patch) | |
tree | 5e234b5a10d8be48542f952f31b36c6dbc20044d | |
parent | fe8202d39c32032b68a7a6760651c843b2e3e16d (diff) | |
download | libmicrohttpd-d9ab40f53238b49c9f4a4df13e0262fbefb4a95a.tar.gz libmicrohttpd-d9ab40f53238b49c9f4a4df13e0262fbefb4a95a.zip |
-cleaner behavior with respect to stopping to read pipelined requests
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/examples/demo.c | 1 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 9 |
3 files changed, 16 insertions, 2 deletions
@@ -1,3 +1,11 @@ | |||
1 | Fri Jun 28 14:05:15 CEST 2013 | ||
2 | If we shutdown connection for reading on POST due to error, | ||
3 | really do not process further requests even if we already | ||
4 | read the next request from the connection. Furthermore, do | ||
5 | not shutdown connections for reading on GET/HEAD/etc. just | ||
6 | because the application queued a response immediately --- | ||
7 | reserve that behavior for PUT/POST. -CG | ||
8 | |||
1 | Tue May 21 14:34:36 CEST 2013 | 9 | Tue May 21 14:34:36 CEST 2013 |
2 | Improving configure tests for OpenSSL and spdylay to | 10 | Improving configure tests for OpenSSL and spdylay to |
3 | avoid build errors in libmicrospdy code if those libraries | 11 | avoid build errors in libmicrospdy code if those libraries |
diff --git a/src/examples/demo.c b/src/examples/demo.c index 281d594e..4e7c5d2a 100644 --- a/src/examples/demo.c +++ b/src/examples/demo.c | |||
@@ -819,6 +819,7 @@ ignore_sigpipe () | |||
819 | } | 819 | } |
820 | #endif | 820 | #endif |
821 | 821 | ||
822 | |||
822 | /** | 823 | /** |
823 | * Entry point to demo. Note: this HTTP server will make all | 824 | * Entry point to demo. Note: this HTTP server will make all |
824 | * files in the current directory and its subdirectories available | 825 | * files in the current directory and its subdirectories available |
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 8cd64000..4d651a39 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -2221,7 +2221,11 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
2221 | connection->state = MHD_CONNECTION_CONTINUE_SENDING; | 2221 | connection->state = MHD_CONNECTION_CONTINUE_SENDING; |
2222 | break; | 2222 | break; |
2223 | } | 2223 | } |
2224 | if (connection->response != NULL) | 2224 | if ( (NULL != connection->response) && |
2225 | ( (0 == strcasecmp (connection->method, | ||
2226 | MHD_HTTP_METHOD_POST)) || | ||
2227 | (0 == strcasecmp (connection->method, | ||
2228 | MHD_HTTP_METHOD_PUT))) ) | ||
2225 | { | 2229 | { |
2226 | /* we refused (no upload allowed!) */ | 2230 | /* we refused (no upload allowed!) */ |
2227 | connection->remaining_upload_size = 0; | 2231 | connection->remaining_upload_size = 0; |
@@ -2413,7 +2417,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
2413 | end = | 2417 | end = |
2414 | MHD_get_response_header (connection->response, | 2418 | MHD_get_response_header (connection->response, |
2415 | MHD_HTTP_HEADER_CONNECTION); | 2419 | MHD_HTTP_HEADER_CONNECTION); |
2416 | rend = ( (end != NULL) && (0 == strcasecmp (end, "close")) ); | 2420 | rend = ( (MHD_YES == connection->read_closed) || |
2421 | ( (end != NULL) && (0 == strcasecmp (end, "close")) ) ); | ||
2417 | MHD_destroy_response (connection->response); | 2422 | MHD_destroy_response (connection->response); |
2418 | connection->response = NULL; | 2423 | connection->response = NULL; |
2419 | if (connection->daemon->notify_completed != NULL) | 2424 | if (connection->daemon->notify_completed != NULL) |