gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 04/06: parse_connection_headers(): simplified 'Content-L


From: gnunet
Subject: [libmicrohttpd] 04/06: parse_connection_headers(): simplified 'Content-Length' processing
Date: Wed, 24 Nov 2021 19:57:13 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit e9e6a5f9d6ed3b328a78c749270733e6fd6c7ba6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Nov 24 16:22:45 2021 +0300

    parse_connection_headers(): simplified 'Content-Length' processing
---
 src/microhttpd/connection.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 816bd5a8..74660bc5 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3543,7 +3543,7 @@ parse_connection_headers (struct MHD_Connection 
*connection)
 {
   const char *clen;
   const char *enc;
-  const char *end;
+  size_t val_len;
 
   parse_cookie_header (connection);
   if ( (1 <= connection->daemon->strict_for_client) &&
@@ -3589,12 +3589,15 @@ parse_connection_headers (struct MHD_Connection 
*connection)
                                                  MHD_STATICSTR_LEN_ (
                                                    
MHD_HTTP_HEADER_CONTENT_LENGTH),
                                                  &clen,
-                                                 NULL))
+                                                 &val_len))
     {
-      end = clen + MHD_str_to_uint64_ (clen,
-                                       &connection->remaining_upload_size);
-      if ( (clen == end) ||
-           ('\0' != *end) )
+      size_t num_digits;
+
+      num_digits = MHD_str_to_uint64_n_ (clen,
+                                         val_len,
+                                         &connection->remaining_upload_size);
+      if ( (val_len != num_digits) ||
+           (0 == num_digits) )
       {
         connection->remaining_upload_size = 0;
 #ifdef HAVE_MESSAGES

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