gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (d874f86d -> 218f32f4)


From: gnunet
Subject: [libmicrohttpd] branch master updated (d874f86d -> 218f32f4)
Date: Tue, 30 Jan 2024 17:33:28 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from d874f86d Fuzz test: increased tests' timeout value
     new d63cb667 Muted extra compiler warnings
     new 7711d013 test_str: reduced number of extra checked locales
     new 218f32f4 test_digestauth2: supported old libcurl versions

The 3 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/examples/websocket_threaded_example.c |  2 +-
 src/microhttpd/mhd_str.c                  | 18 +++++-----
 src/microhttpd/test_client_put_stop.c     | 12 +++----
 src/microhttpd/test_str.c                 | 55 +++++++++++++++----------------
 src/testcurl/test_digestauth2.c           | 17 ++++++----
 5 files changed, 54 insertions(+), 50 deletions(-)

diff --git a/src/examples/websocket_threaded_example.c 
b/src/examples/websocket_threaded_example.c
index 3047fc7d..1c98b428 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -675,7 +675,7 @@ ws_receive_frame (unsigned char *frame, ssize_t *length, 
int *type)
     {
       idx_first_mask = 10;
     }
-    idx_first_data = idx_first_mask + 4;
+    idx_first_data = (unsigned char) (idx_first_mask + 4);
     data_length = (size_t) *length - idx_first_data;
     masks[0] = frame[idx_first_mask + 0];
     masks[1] = frame[idx_first_mask + 1];
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 8943b46e..d01086ac 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1073,7 +1073,7 @@ MHD_str_remove_tokens_caseless_ (char *str,
       while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt]))
         pt++;
       /* Found end of the token string or non-whitespace char */
-    } while(pt < tokens_len && ',' != t[pt]);
+    } while (pt < tokens_len && ',' != t[pt]);
 
     /* 'tkn' is the input token with 'tkn_len' chars */
     mhd_assert (0 != tkn_len);
@@ -1531,8 +1531,10 @@ MHD_uint32_to_strx (uint32_t val,
 
   while (o_pos < buf_size)
   {
-    buf[o_pos++] = (digit <= 9) ? ('0' + (char) digit) :
-                   ('A' + (char) digit - 10);
+    buf[o_pos++] =
+      (char) ((digit <= 9) ?
+              ('0' + (char) digit) :
+              ('A' + (char) digit - 10));
     if (0 == digit_pos)
       return o_pos;
     digit_pos--;
@@ -1568,7 +1570,7 @@ MHD_uint16_to_str (uint16_t val,
 
   while (0 != buf_size)
   {
-    *chr = (char) digit + '0';
+    *chr = (char) ((char) digit + '0');
     chr++;
     buf_size--;
     if (1 == divisor)
@@ -1609,7 +1611,7 @@ MHD_uint64_to_str (uint64_t val,
 
   while (0 != buf_size)
   {
-    *chr = (char) digit + '0';
+    *chr = (char) ((char) digit + '0');
     chr++;
     buf_size--;
     if (1 == divisor)
@@ -1644,7 +1646,7 @@ MHD_uint8_to_str_pad (uint8_t val,
   }
   else
   {
-    buf[pos++] = '0' + (char) digit;
+    buf[pos++] = (char) ('0' + (char) digit);
     val %= 100;
     min_digits = 2;
   }
@@ -1659,13 +1661,13 @@ MHD_uint8_to_str_pad (uint8_t val,
   }
   else
   {
-    buf[pos++] = '0' + (char) digit;
+    buf[pos++] = (char) ('0' + (char) digit);
     val %= 10;
   }
 
   if (buf_size <= pos)
     return 0;
-  buf[pos++] = '0' + (char) val;
+  buf[pos++] = (char) ('0' + (char) val);
   return pos;
 }
 
diff --git a/src/microhttpd/test_client_put_stop.c 
b/src/microhttpd/test_client_put_stop.c
index aaf5c829..3a6c1865 100644
--- a/src/microhttpd/test_client_put_stop.c
+++ b/src/microhttpd/test_client_put_stop.c
@@ -1964,17 +1964,17 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   {
     *pport = 4170;
     if (use_shutdown)
-      *pport += 0;
+      *pport = (uint16_t) (*pport + 0);
     if (use_close)
-      *pport += 1;
+      *pport = (uint16_t) (*pport + 1);
     if (use_hard_close)
-      *pport += 1;
+      *pport = (uint16_t) (*pport + 1);
     if (by_step)
-      *pport += 1 << 2;
+      *pport = (uint16_t) (*pport + (1 << 2));
     if (upl_chunked)
-      *pport += 1 << 3;
+      *pport = (uint16_t) (*pport + (1 << 3));
     if (! oneone)
-      *pport += 1 << 4;
+      *pport = (uint16_t) (*pport + (1 << 4));
   }
 
   if (testMhdThreadExternal == thrType)
diff --git a/src/microhttpd/test_str.c b/src/microhttpd/test_str.c
index aa78998a..a41c0be5 100644
--- a/src/microhttpd/test_str.c
+++ b/src/microhttpd/test_str.c
@@ -63,14 +63,21 @@ static const char *const locale_names[] = {
   ".1250",
   ".1251",
   ".1252",
+  "en",
+  "english",
+  "French_France",
+  "Turkish_Turkey.1254",
+  "de",
+  "zh-Hans",
+  "ru-RU.1251"
+#if 0 /* Disabled extra checks */
+  ,
   ".1254",
   ".20866",   /* number for KOI8-R */
   ".28591",   /* number for ISO-8859-1 */
   ".28595",   /* number for ISO-8859-5 */
   ".28599",   /* number for ISO-8859-9 */
   ".28605",   /* number for ISO-8859-15 */
-  "en",
-  "english",
   "en-US",
   "English-US",
   "en-US.437",
@@ -82,14 +89,12 @@ static const char *const locale_names[] = {
   "fra",
   "french",
   "fr-FR",
-  "French_France",
   "fr-FR.850",
   "french_france.850",
   "fr-FR.1252",
   "French_france.1252",
   "French_france.28605",
   "French_France.65001",
-  "de",
   "de-DE",
   "de-DE.850",
   "German_Germany.850",
@@ -103,7 +108,6 @@ static const char *const locale_names[] = {
   "turkish",
   "tr-TR",
   "tr-TR.1254",
-  "Turkish_Turkey.1254",
   "tr-TR.857",
   "Turkish_Turkey.857",
   "Turkish_Turkey.28599",
@@ -113,14 +117,13 @@ static const char *const locale_names[] = {
   "Russian",
   "ru-RU.866",
   "Russian_Russia.866",
-  "ru-RU.1251",
   "Russian_Russia.1251",
   "Russian_Russia.20866",
   "Russian_Russia.28595",
   "Russian_Russia.65001",
-  "zh-Hans",
   "zh-Hans.936",
   "chinese-simplified"
+#endif /* Disabled extra checks */
 #else /* ! _WIN32 || __CYGWIN__ */
   "C.UTF-8",
   "POSIX",
@@ -424,7 +427,8 @@ static const struct two_eq_strs eq_strings[] = {
      
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
      
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
      
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
-     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
+     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")
+   ,
    D_STR_W_LEN (
      
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
      "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f 
!\"#$%&'()*+,-./0123456789:;<=>?@ab"
@@ -434,7 +438,8 @@ static const struct two_eq_strs eq_strings[] = {
      
"\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5"
      
"\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9"
      
"\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed"
-     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")}    
         /* Full with A/a match */
+     
"\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff")
+  }                                                                            
               /* Full with A/a match */
 };
 
 struct two_neq_strs
@@ -1747,11 +1752,9 @@ check_strx_to_uint32_all_chars (void)
     {
       static const uint32_t rnd_val = 234234;
       size_t rs;
-      if (((c >= '0') && (c <= '9') ) || ((c >= 'A') && (c <= 'F') ) || ((c >=
-                                                                          'a')
-                                                                         &&
-                                                                         (c <=
-                                                                          'f') 
))
+      if (( (c >= '0') && (c <= '9') )
+          || ( (c >= 'A') && (c <= 'F') )
+          || ( (c >= 'a') && (c <= 'f') ))
         continue;     /* skip xdigits */
       for (test_val = 0; test_val <= rnd_val && ! c_failed[c]; test_val +=
              rnd_val)
@@ -2033,11 +2036,9 @@ check_strx_to_uint32_n_all_chars (void)
       size_t rs;
       size_t len;
 
-      if (((c >= '0') && (c <= '9') ) || ((c >= 'A') && (c <= 'F') ) || ((c >=
-                                                                          'a')
-                                                                         &&
-                                                                         (c <=
-                                                                          'f') 
))
+      if (( (c >= '0') && (c <= '9') )
+          || ( (c >= 'A') && (c <= 'F') )
+          || ( (c >= 'a') && (c <= 'f') ))
         continue;     /* skip xdigits */
 
       for (len = 0; len <= 5; len++)
@@ -2350,11 +2351,9 @@ check_strx_to_uint64_all_chars (void)
     {
       static const uint64_t rnd_val = 234234;
       size_t rs;
-      if (((c >= '0') && (c <= '9') ) || ((c >= 'A') && (c <= 'F') ) || ((c >=
-                                                                          'a')
-                                                                         &&
-                                                                         (c <=
-                                                                          'f') 
))
+      if (( (c >= '0') && (c <= '9') )
+          || ( (c >= 'A') && (c <= 'F') )
+          || ( (c >= 'a') && (c <= 'f') ))
         continue;     /* skip xdigits */
       for (test_val = 0; test_val <= rnd_val && ! c_failed[c]; test_val +=
              rnd_val)
@@ -2610,11 +2609,9 @@ check_strx_to_uint64_n_all_chars (void)
       size_t rs;
       size_t len;
 
-      if (((c >= '0') && (c <= '9') ) || ((c >= 'A') && (c <= 'F') ) || ((c >=
-                                                                          'a')
-                                                                         &&
-                                                                         (c <=
-                                                                          'f') 
))
+      if (( (c >= '0') && (c <= '9') )
+          || ( (c >= 'A') && (c <= 'F') )
+          || ( (c >= 'a') && (c <= 'f') ))
         continue;     /* skip xdigits */
 
       for (len = 0; len <= 5; len++)
diff --git a/src/testcurl/test_digestauth2.c b/src/testcurl/test_digestauth2.c
index 2ec78e26..9566159d 100644
--- a/src/testcurl/test_digestauth2.c
+++ b/src/testcurl/test_digestauth2.c
@@ -568,7 +568,13 @@ ahc_echo (void *cls,
       }
       if (! test_rfc2069)
       {
-        if (10 >= dinfo->cnonce_len)
+        if (
+#if CURL_AT_LEAST_VERSION (7,37,1)
+          10 >= dinfo->cnonce_len
+#else  /* libcurl before 7.37.1 */
+          8 > dinfo->cnonce_len
+#endif /* libcurl before 7.37.1 */
+          )
         {
           fprintf (stderr, "Unexpected small 'cnonce_len': %ld. ",
                    (long) dinfo->cnonce_len);
@@ -879,11 +885,10 @@ ahc_echo (void *cls,
       if (NULL == response)
         mhdErrorExitDesc ("Response creation failed");
       res =
-        MHD_queue_auth_required_response3 (connection, REALM_VAL, OPAQUE_VALUE,
-                                           "/", response, 0,
-                                           (enum MHD_DigestAuthMultiQOP) qop,
-                                           (enum MHD_DigestAuthMultiAlgo3) 
algo3,
-                                           test_userhash, 0);
+        MHD_queue_auth_required_response3 (
+          connection, REALM_VAL, OPAQUE_VALUE, "/", response, 0,
+          (enum MHD_DigestAuthMultiQOP) qop,
+          (enum MHD_DigestAuthMultiAlgo3) algo3, test_userhash, 0);
       if (MHD_YES != res)
         mhdErrorExitDesc ("'MHD_queue_auth_required_response3()' failed");
     }

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