diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-10-21 10:01:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-10-21 10:01:52 +0200 |
commit | 567aa11a97f0562842f10e2763fb4804166a0cb2 (patch) | |
tree | b13e7702c8e8d412fdd131aac8f5996143f4b45e | |
parent | e55249435fa32e514af322da7af90d0bc4d9fabd (diff) | |
download | libmicrohttpd-567aa11a97f0562842f10e2763fb4804166a0cb2.tar.gz libmicrohttpd-567aa11a97f0562842f10e2763fb4804166a0cb2.zip |
Fix #6610 as suggested by AP
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 23 |
2 files changed, 12 insertions, 16 deletions
@@ -1,3 +1,6 @@ | |||
1 | Wed 21 Oct 2020 10:00:58 AM CEST | ||
2 | Corking should be OFF when sending the footer (#6610). -AP/CG | ||
3 | |||
1 | Wed 07 Oct 2020 11:07:00 MSK | 4 | Wed 07 Oct 2020 11:07:00 MSK |
2 | W32 default target version changed to Vista, XP is still supported. | 5 | W32 default target version changed to Vista, XP is still supported. |
3 | Minor fixes and additional asserts for memorypool. | 6 | Minor fixes and additional asserts for memorypool. |
@@ -17,7 +20,7 @@ Thu 24 Sep 2020 16:55:00 MSK | |||
17 | Fixed compiler warnings on W32. | 20 | Fixed compiler warnings on W32. |
18 | Minor optimisation of MHD_YES/MHD_NO internal usage. | 21 | Minor optimisation of MHD_YES/MHD_NO internal usage. |
19 | Refactor and cleanup of internal debugging macros. | 22 | Refactor and cleanup of internal debugging macros. |
20 | Updated HTTP status codes, header names and methods from | 23 | Updated HTTP status codes, header names and methods from |
21 | the registries. | 24 | the registries. |
22 | Fixed portability of test_upgrade_large. | 25 | Fixed portability of test_upgrade_large. |
23 | Minor testsuite fixes. | 26 | Minor testsuite fixes. |
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 98e58123..94ed459d 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -615,8 +615,7 @@ MHD_connection_mark_closed_ (struct MHD_Connection *connection) | |||
615 | * and do not shutdown TCP socket. This give more | 615 | * and do not shutdown TCP socket. This give more |
616 | * chances to send TLS closure data to remote side. | 616 | * chances to send TLS closure data to remote side. |
617 | * Closure of TLS layer will be interpreted by | 617 | * Closure of TLS layer will be interpreted by |
618 | * remote side as end of transmission. */ | 618 | * remote side as end of transmission. */if (0 != (daemon->options & MHD_USE_TLS)) |
619 | if (0 != (daemon->options & MHD_USE_TLS)) | ||
620 | { | 619 | { |
621 | if (! MHD_tls_connection_shutdown (connection)) | 620 | if (! MHD_tls_connection_shutdown (connection)) |
622 | shutdown (connection->socket_fd, | 621 | shutdown (connection->socket_fd, |
@@ -730,8 +729,7 @@ MHD_connection_finish_forward_ (struct MHD_Connection *connection) | |||
730 | * used with MHD_UPGRADE_ACTION_CLOSE. They will be | 729 | * used with MHD_UPGRADE_ACTION_CLOSE. They will be |
731 | * closed by MHD_cleanup_upgraded_connection_() during | 730 | * closed by MHD_cleanup_upgraded_connection_() during |
732 | * connection's final cleanup. | 731 | * connection's final cleanup. |
733 | */ | 732 | */} |
734 | } | ||
735 | 733 | ||
736 | 734 | ||
737 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT*/ | 735 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT*/ |
@@ -1144,8 +1142,7 @@ try_grow_read_buffer (struct MHD_Connection *connection, | |||
1144 | the right position in the pool, say because someone called | 1142 | the right position in the pool, say because someone called |
1145 | MHD_pool_allocate() without 'from_end' set to 'true'? Anyway, | 1143 | MHD_pool_allocate() without 'from_end' set to 'true'? Anyway, |
1146 | should be investigated! (Ideally provide all data from | 1144 | should be investigated! (Ideally provide all data from |
1147 | *pool and connection->read_buffer and new_size for debugging). */ | 1145 | *pool and connection->read_buffer and new_size for debugging). */mhd_assert (0); |
1148 | mhd_assert (0); | ||
1149 | return false; | 1146 | return false; |
1150 | } | 1147 | } |
1151 | connection->read_buffer = rb; | 1148 | connection->read_buffer = rb; |
@@ -1370,8 +1367,7 @@ build_header_response (struct MHD_Connection *connection) | |||
1370 | 1367 | ||
1371 | Note that the change from 'SHOULD NOT' to 'MUST NOT' is | 1368 | Note that the change from 'SHOULD NOT' to 'MUST NOT' is |
1372 | a recent development of the HTTP 1.1 specification. | 1369 | a recent development of the HTTP 1.1 specification. |
1373 | */ | 1370 | */content_length_len |
1374 | content_length_len | ||
1375 | = MHD_snprintf_ (content_length_buf, | 1371 | = MHD_snprintf_ (content_length_buf, |
1376 | sizeof (content_length_buf), | 1372 | sizeof (content_length_buf), |
1377 | MHD_HTTP_HEADER_CONTENT_LENGTH ": " | 1373 | MHD_HTTP_HEADER_CONTENT_LENGTH ": " |
@@ -1704,8 +1700,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1704 | or if we do nothing, we would just timeout | 1700 | or if we do nothing, we would just timeout |
1705 | on the connection (if a timeout is even | 1701 | on the connection (if a timeout is even |
1706 | set!). | 1702 | set!). |
1707 | Solution: we kill the connection with an error */ | 1703 | Solution: we kill the connection with an error */transmit_error_response (connection, |
1708 | transmit_error_response (connection, | ||
1709 | MHD_HTTP_INTERNAL_SERVER_ERROR, | 1704 | MHD_HTTP_INTERNAL_SERVER_ERROR, |
1710 | INTERNAL_ERROR); | 1705 | INTERNAL_ERROR); |
1711 | continue; | 1706 | continue; |
@@ -2479,8 +2474,7 @@ process_header_line (struct MHD_Connection *connection, | |||
2479 | header at the beginning of the while | 2474 | header at the beginning of the while |
2480 | loop since we need to be able to inspect | 2475 | loop since we need to be able to inspect |
2481 | the *next* header line (in case it starts | 2476 | the *next* header line (in case it starts |
2482 | with a space...) */ | 2477 | with a space...) */connection->last = line; |
2483 | connection->last = line; | ||
2484 | connection->colon = colon; | 2478 | connection->colon = colon; |
2485 | return MHD_YES; | 2479 | return MHD_YES; |
2486 | } | 2480 | } |
@@ -2527,8 +2521,7 @@ process_broken_line (struct MHD_Connection *connection, | |||
2527 | adjacency); also, in the case where these are not adjacent | 2521 | adjacency); also, in the case where these are not adjacent |
2528 | (not sure how it can happen!), we would want to allocate from | 2522 | (not sure how it can happen!), we would want to allocate from |
2529 | the end of the pool, so as to not destroy the read-buffer's | 2523 | the end of the pool, so as to not destroy the read-buffer's |
2530 | ability to grow nicely. */ | 2524 | ability to grow nicely. */last = MHD_pool_reallocate (connection->pool, |
2531 | last = MHD_pool_reallocate (connection->pool, | ||
2532 | last, | 2525 | last, |
2533 | last_len + 1, | 2526 | last_len + 1, |
2534 | last_len + tmp_len + 1); | 2527 | last_len + tmp_len + 1); |
@@ -3078,7 +3071,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
3078 | [connection->write_buffer_send_offset], | 3071 | [connection->write_buffer_send_offset], |
3079 | connection->write_buffer_append_offset | 3072 | connection->write_buffer_append_offset |
3080 | - connection->write_buffer_send_offset, | 3073 | - connection->write_buffer_send_offset, |
3081 | MHD_SSO_HDR_CORK); | 3074 | MHD_SSO_NO_CORK); |
3082 | if (ret < 0) | 3075 | if (ret < 0) |
3083 | { | 3076 | { |
3084 | if (MHD_ERR_AGAIN_ == ret) | 3077 | if (MHD_ERR_AGAIN_ == ret) |