gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (3a02f18c -> 746dae6a)


From: gnunet
Subject: [libmicrohttpd] branch master updated (3a02f18c -> 746dae6a)
Date: Sun, 17 Oct 2021 14:14:28 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 3a02f18c Simplified connection.c code: reused error reply function
     new e33dd19d A missing part for 3a02f18ca6a66997614cebf1231c86ad33148ad2
     new 746dae6a Added error response for wrong 'Content-Length' values

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/microhttpd/connection.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index f973c93e..eb161ce7 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -114,6 +114,18 @@
 #define REQUEST_CHUNKED_MALFORMED ""
 #endif
 
+/**
+ * Response text used when the request HTTP chunked encoding is
+ * malformed.
+ */
+#ifdef HAVE_MESSAGES
+#define REQUEST_CONTENTLENGTH_MALFORMED \
+  "<html><head><title>Request malformed</title></head>" \
+  "<body>Your HTTP request has wrong value for <b>Content-Length</b> 
header.</body></html>"
+#else
+#define REQUEST_CHUNKED_MALFORMED ""
+#endif
+
 /**
  * Response text used when there is an internal server error.
  *
@@ -3460,11 +3472,6 @@ parse_connection_headers (struct MHD_Connection 
*connection)
                                        NULL,
                                        NULL)) )
   {
-    enum MHD_Result iret;
-
-    /* die, http 1.1 request without host and we are pedantic */
-    connection->stop_with_error = true;
-    connection->state = MHD_CONNECTION_FULL_REQ_RECEIVED;
 #ifdef HAVE_MESSAGES
     MHD_DLOG (connection->daemon,
               _ ("Received HTTP/1.1 request without `Host' header.\n"));
@@ -3510,8 +3517,9 @@ parse_connection_headers (struct MHD_Connection 
*connection)
                   _ (
                     "Failed to parse `Content-Length' header. Closing 
connection.\n"));
 #endif
-        CONNECTION_CLOSE_ERROR (connection,
-                                NULL);
+        transmit_error_response_static (connection,
+                                        MHD_HTTP_BAD_REQUEST,
+                                        REQUEST_CONTENTLENGTH_MALFORMED);
         return;
       }
     }

-- 
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]