gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated: correct interpretation of revalue


From: gnunet
Subject: [libmicrohttpd] branch master updated: correct interpretation of revalue of MHD_socket_cork_
Date: Sun, 27 Sep 2020 22:43:06 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 123b86d1 correct interpretation of revalue of MHD_socket_cork_
123b86d1 is described below

commit 123b86d1e4790d9717eff7c0502313f0fdb1c018
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Sep 27 22:36:17 2020 +0200

    correct interpretation of revalue of MHD_socket_cork_
---
 src/microhttpd/connection.c | 8 ++++++--
 src/microhttpd/mhd_send.c   | 1 +
 src/microhttpd/response.c   | 6 ++++--
 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,
 {
   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);
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,
                 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,
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,
     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))
       {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]