gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 02/02: Simplified connection.c code: reused error reply


From: gnunet
Subject: [libmicrohttpd] 02/02: Simplified connection.c code: reused error reply function
Date: Sun, 17 Oct 2021 12:57:47 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 3a02f18ca6a66997614cebf1231c86ad33148ad2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 17 13:57:22 2021 +0300

    Simplified connection.c code: reused error reply function
---
 src/microhttpd/connection.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 62e21d03..f973c93e 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3467,32 +3467,11 @@ parse_connection_headers (struct MHD_Connection 
*connection)
     connection->state = MHD_CONNECTION_FULL_REQ_RECEIVED;
 #ifdef HAVE_MESSAGES
     MHD_DLOG (connection->daemon,
-              _ ("Received HTTP 1.1 request without `Host' header.\n"));
+              _ ("Received HTTP/1.1 request without `Host' header.\n"));
 #endif
-    mhd_assert (NULL == connection->response);
-    response =
-      MHD_create_response_from_buffer (MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST),
-                                       REQUEST_LACKS_HOST,
-                                       MHD_RESPMEM_PERSISTENT);
-    if (NULL == response)
-    {
-      /* can't even send a reply, at least close the connection */
-      CONNECTION_CLOSE_ERROR (connection,
-                              _ (
-                                "Closing connection (failed to create 
response)."));
-      return;
-    }
-    iret = MHD_queue_response (connection,
-                               MHD_HTTP_BAD_REQUEST,
-                               response);
-    MHD_destroy_response (response);
-    if (MHD_NO == iret)
-    {
-      /* can't even send a reply, at least close the connection */
-      CONNECTION_CLOSE_ERROR (connection,
-                              _ (
-                                "Closing connection (failed to queue 
response)."));
-    }
+    transmit_error_response_static (connection,
+                                    MHD_HTTP_BAD_REQUEST,
+                                    REQUEST_LACKS_HOST);
     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]