gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 07/15: Do not send "100 Continue" if request does not ha


From: gnunet
Subject: [libmicrohttpd] 07/15: Do not send "100 Continue" if request does not have a body
Date: Fri, 28 Oct 2022 11:21:56 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 692e8c56553a4ec0a432704816b8340711b68aed
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Oct 21 09:53:05 2022 +0300

    Do not send "100 Continue" if request does not have a body
---
 src/microhttpd/connection.c | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 9589a2d8..885557b5 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -765,17 +765,27 @@ need_100_continue (struct MHD_Connection *connection)
 {
   const char *expect;
 
-  return (MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver) &&
-          (MHD_NO !=
-           MHD_lookup_connection_value_n (connection,
-                                          MHD_HEADER_KIND,
-                                          MHD_HTTP_HEADER_EXPECT,
-                                          MHD_STATICSTR_LEN_ (
-                                            MHD_HTTP_HEADER_EXPECT),
-                                          &expect,
-                                          NULL)) &&
-          (MHD_str_equal_caseless_ (expect,
-                                    "100-continue")) );
+  if (! MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver))
+    return false;
+
+  if (0 == connection->rq.remaining_upload_size)
+    return false;
+
+  if (MHD_NO ==
+      MHD_lookup_connection_value_n (connection,
+                                     MHD_HEADER_KIND,
+                                     MHD_HTTP_HEADER_EXPECT,
+                                     MHD_STATICSTR_LEN_ ( \
+                                       MHD_HTTP_HEADER_EXPECT),
+                                     &expect,
+                                     NULL))
+    return false;
+
+  if (MHD_str_equal_caseless_ (expect,
+                               "100-continue"))
+    return true;
+
+  return 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]