aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/microhttpd/connection.c8
-rw-r--r--src/microhttpd/mhd_send.c1
-rw-r--r--src/microhttpd/response.c6
3 files changed, 11 insertions, 4 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index b2197310..21f5a651 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2441,7 +2441,10 @@ check_write_done (struct MHD_Connection *connection,
2441{ 2441{
2442 if ( (connection->write_buffer_append_offset != 2442 if ( (connection->write_buffer_append_offset !=
2443 connection->write_buffer_send_offset) || 2443 connection->write_buffer_send_offset) ||
2444 (connection->sk_cork_on) ) 2444 /* if we expected to turn cork off, and it is still on,
2445 we are not finished sending (can happen with gnutls_record_uncork) */
2446 ( (connection->sk_cork_on) &&
2447 (MHD_CONNECTION_HEADERS_SENDING != connection->state) ) )
2445 return MHD_NO; 2448 return MHD_NO;
2446 connection->write_buffer_append_offset = 0; 2449 connection->write_buffer_append_offset = 0;
2447 connection->write_buffer_send_offset = 0; 2450 connection->write_buffer_send_offset = 0;
@@ -2555,7 +2558,8 @@ process_broken_line (struct MHD_Connection *connection,
2555 adjacency); also, in the case where these are not adjacent 2558 adjacency); also, in the case where these are not adjacent
2556 (not sure how it can happen!), we would want to allocate from 2559 (not sure how it can happen!), we would want to allocate from
2557 the end of the pool, so as to not destroy the read-buffer's 2560 the end of the pool, so as to not destroy the read-buffer's
2558 ability to grow nicely. */last = MHD_pool_reallocate (connection->pool, 2561 ability to grow nicely. *///
2562 last = MHD_pool_reallocate (connection->pool,
2559 last, 2563 last,
2560 last_len + 1, 2564 last_len + 1,
2561 last_len + tmp_len + 1); 2565 last_len + tmp_len + 1);
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index f366ef67..339dad2b 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -330,6 +330,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
330 buffer, 330 buffer,
331 buffer_size, 331 buffer_size,
332 MAYBE_MSG_NOSIGNAL | (want_cork ? MSG_MORE : 0)); 332 MAYBE_MSG_NOSIGNAL | (want_cork ? MSG_MORE : 0));
333 connection->sk_cork_on = want_cork; /* pretend corking happened as requested */
333#else 334#else
334 ret = send (connection->socket_fd, 335 ret = send (connection->socket_fd,
335 buffer, 336 buffer,
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 9a21925a..27386046 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -904,7 +904,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
904 else 904 else
905#endif 905#endif
906 { 906 {
907 if (0 == 907 if (0 !=
908 MHD_socket_cork_ (connection->socket_fd, 908 MHD_socket_cork_ (connection->socket_fd,
909 true)) 909 true))
910 { 910 {
@@ -930,7 +930,9 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
930 else 930 else
931#endif 931#endif
932 { 932 {
933 if (0 == 933 if (! connection->sk_cork_on)
934 return MHD_YES;
935 if (0 !=
934 MHD_socket_cork_ (connection->socket_fd, 936 MHD_socket_cork_ (connection->socket_fd,
935 false)) 937 false))
936 { 938 {