correct interpretation of revalue of MHD_socket_cork_

This commit is contained in:
Christian Grothoff
2020-09-27 22:36:17 +02:00
parent beb7fa828c
commit 123b86d1e4
3 changed files with 11 additions and 4 deletions
+6 -2
View File
@@ -2441,7 +2441,10 @@ check_write_done (struct MHD_Connection *connection,
{
if ( (connection->write_buffer_append_offset !=
connection->write_buffer_send_offset) ||
(connection->sk_cork_on) )
/* if we expected to turn cork off, and it is still on,
we are not finished sending (can happen with gnutls_record_uncork) */
( (connection->sk_cork_on) &&
(MHD_CONNECTION_HEADERS_SENDING != connection->state) ) )
return MHD_NO;
connection->write_buffer_append_offset = 0;
connection->write_buffer_send_offset = 0;
@@ -2555,7 +2558,8 @@ process_broken_line (struct MHD_Connection *connection,
adjacency); also, in the case where these are not adjacent
(not sure how it can happen!), we would want to allocate from
the end of the pool, so as to not destroy the read-buffer's
ability to grow nicely. */last = MHD_pool_reallocate (connection->pool,
ability to grow nicely. *///
last = MHD_pool_reallocate (connection->pool,
last,
last_len + 1,
last_len + tmp_len + 1);
+1
View File
@@ -330,6 +330,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
buffer,
buffer_size,
MAYBE_MSG_NOSIGNAL | (want_cork ? MSG_MORE : 0));
connection->sk_cork_on = want_cork; /* pretend corking happened as requested */
#else
ret = send (connection->socket_fd,
buffer,
+4 -2
View File
@@ -904,7 +904,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
else
#endif
{
if (0 ==
if (0 !=
MHD_socket_cork_ (connection->socket_fd,
true))
{
@@ -930,7 +930,9 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
else
#endif
{
if (0 ==
if (! connection->sk_cork_on)
return MHD_YES;
if (0 !=
MHD_socket_cork_ (connection->socket_fd,
false))
{