gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: avoid assertions from addin


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: avoid assertions from adding headers that MHD deals with internally
Date: Sat, 09 Feb 2019 15:43:48 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new c03183d3e avoid assertions from adding headers that MHD deals with 
internally
c03183d3e is described below

commit c03183d3e196645f955133867c0892c7f08769f5
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Feb 9 15:43:47 2019 +0100

    avoid assertions from adding headers that MHD deals with internally
---
 src/gns/gnunet-gns-proxy.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index e21deabde..21451651d 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1362,11 +1362,27 @@ create_mhd_response_from_s5r (struct Socks5Request *s5r)
        NULL != header;
        header = header->next)
   {
-    GNUNET_break (MHD_YES ==
-                  MHD_add_response_header (s5r->response,
-                                           header->type,
-                                           header->value));
-
+    if (0 == strcasecmp (header->type,
+                         MHD_HTTP_HEADER_CONTENT_LENGTH))
+      continue; /* MHD won't let us mess with those, for good reason */
+    if ( (0 == strcasecmp (header->type,
+                           MHD_HTTP_HEADER_TRANSFER_ENCODING)) &&
+         ( (0 == strcasecmp (header->value,
+                             "identity")) ||
+           (0 == strcasecmp (header->value,
+                             "chunked")) ) )
+      continue; /* MHD won't let us mess with those, for good reason */
+    if (MHD_YES !=
+        MHD_add_response_header (s5r->response,
+                                 header->type,
+                                 header->value))
+    {
+      GNUNET_break (0);
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Failed to add header `%s:%s'\n",
+                  header->type,
+                  header->value);
+    }
   }
   /* force connection to be closed after each request, as we
      do not support HTTP pipelining (yet, FIXME!) */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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