gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (19e8d323 -> e0251c6d)


From: gnunet
Subject: [libmicrohttpd] branch master updated (19e8d323 -> e0251c6d)
Date: Sun, 12 Dec 2021 14:13:05 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 19e8d323 configure: really disable leak sanitizer if it's disabled by 
configure parameters
     new 9496be92 postprocessor.c: cosmetics
     new b4f1e487 Fixed compatibility with old GnuTLS versions
     new 69854dc4 mhd_send: fixed formatting style
     new a08cfbe7 Fixed tests compatibility with old libcurl
     new e0251c6d test_get_chunked: follow HTTP specification

The 5 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_https.c        |  5 +++++
 src/microhttpd/daemon.c                  |  3 +++
 src/microhttpd/mhd_send.c                |  9 +++++++--
 src/microhttpd/postprocessor.c           |  2 +-
 src/testcurl/test_get_chunked.c          |  7 ++++++-
 src/testcurl/test_get_close_keep_alive.c |  8 ++++++++
 src/testcurl/test_tricky.c               | 10 ++++++++++
 7 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/connection_https.c 
b/src/microhttpd/connection_https.c
index aaef7d98..0d691706 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -91,8 +91,13 @@ recv_tls_adapter (struct MHD_Connection *connection,
          (GNUTLS_E_CRYPTODEV_IOCTL_ERROR == res) ||
          (GNUTLS_E_CRYPTODEV_DEVICE_ERROR == res) )
       return MHD_ERR_PIPE_;
+#if defined(GNUTLS_E_PREMATURE_TERMINATION)
     if (GNUTLS_E_PREMATURE_TERMINATION == res)
       return MHD_ERR_CONNRESET_;
+#elif defined(GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
+    if (GNUTLS_E_UNEXPECTED_PACKET_LENGTH == res)
+      return MHD_ERR_CONNRESET_;
+#endif /* GNUTLS_E_UNEXPECTED_PACKET_LENGTH */
     if (GNUTLS_E_MEMORY_ERROR == res)
       return MHD_ERR_NOMEM_;
     /* Treat any other error as a hard error. */
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index a96ec9ae..a75dd0c0 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2317,8 +2317,10 @@ psk_gnutls_adapter (gnutls_session_t session,
 {
   struct MHD_Connection *connection;
   struct MHD_Daemon *daemon;
+#if GNUTLS_VERSION_MAJOR >= 3
   void *app_psk;
   size_t app_psk_size;
+#endif /* GNUTLS_VERSION_MAJOR >= 3 */
 
   connection = gnutls_session_get_ptr (session);
   if (NULL == connection)
@@ -2371,6 +2373,7 @@ psk_gnutls_adapter (gnutls_session_t session,
   free (app_psk);
   return 0;
 #else
+  (void) username; (void) key; /* Mute compiler warning */
 #ifdef HAVE_MESSAGES
   MHD_DLOG (daemon,
             _ ("PSK not supported by this server.\n"));
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 86f76b48..f0ebd38d 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -799,8 +799,13 @@ MHD_send_data_ (struct MHD_Connection *connection,
          (GNUTLS_E_CRYPTODEV_IOCTL_ERROR == ret) ||
          (GNUTLS_E_CRYPTODEV_DEVICE_ERROR == ret) )
       return MHD_ERR_PIPE_;
+#if defined(GNUTLS_E_PREMATURE_TERMINATION)
     if (GNUTLS_E_PREMATURE_TERMINATION == ret)
       return MHD_ERR_CONNRESET_;
+#elif defined(GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
+    if (GNUTLS_E_UNEXPECTED_PACKET_LENGTH == ret)
+      return MHD_ERR_CONNRESET_;
+#endif /* GNUTLS_E_UNEXPECTED_PACKET_LENGTH */
     if (GNUTLS_E_MEMORY_ERROR == ret)
       return MHD_ERR_NOMEM_;
     if (ret < 0)
@@ -1519,7 +1524,7 @@ send_iov_nontls (struct MHD_Connection *connection,
       mhd_assert (r_iov->cnt > r_iov->sent);
       /* The last iov element has been partially sent */
       r_iov->iov[r_iov->sent].iov_base =
-        (void*) ((uint8_t*) r_iov->iov[r_iov->sent].iov_base + (size_t) res);
+        (void *) ((uint8_t *) r_iov->iov[r_iov->sent].iov_base + (size_t) res);
       r_iov->iov[r_iov->sent].iov_len -= (MHD_iov_size_) res;
     }
   }
@@ -1587,7 +1592,7 @@ send_iov_emu (struct MHD_Connection *connection,
       /* Incomplete buffer has been sent.
        * Adjust buffer of the last element. */
       r_iov->iov[r_iov->sent].iov_base =
-        (void*) ((uint8_t*) r_iov->iov[r_iov->sent].iov_base + (size_t) res);
+        (void *) ((uint8_t *) r_iov->iov[r_iov->sent].iov_base + (size_t) res);
       r_iov->iov[r_iov->sent].iov_len -= res;
 
       return total_sent;
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index d03260de..8556624d 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -510,7 +510,7 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
     case PP_Error:
       /* clearly impossible as per while loop invariant */
       abort ();
-      break;
+      break; /* Unreachable */
     case PP_Init:
       /* initial phase */
       mhd_assert (NULL == start_key);
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index e5392d08..5a19a24e 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -20,7 +20,7 @@
 */
 
 /**
- * @file daemontest_get_chunked.c
+ * @file test_get_chunked.c
  * @brief  Testcase for libmicrohttpd GET operations with chunked content 
encoding
  * @author Christian Grothoff
  * @author Karlson2k (Evgeny Grin)
@@ -244,6 +244,11 @@ ahc_echo (void *cls,
                                            "chunked"))
       abort ();
   }
+  if (MHD_NO == MHD_add_response_header (response,
+                                         MHD_HTTP_HEADER_TRAILER,
+                                         RESP_FOOTER_NAME))
+    abort ();
+
   if (resp_string || (resp_sized && resp_empty))
   {
     /* There is no chance to add footer later */
diff --git a/src/testcurl/test_get_close_keep_alive.c 
b/src/testcurl/test_get_close_keep_alive.c
index cb647f67..ea74ab24 100644
--- a/src/testcurl/test_get_close_keep_alive.c
+++ b/src/testcurl/test_get_close_keep_alive.c
@@ -57,6 +57,14 @@
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
 
+#ifndef CURL_VERSION_BITS
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
+#endif /* ! CURL_VERSION_BITS */
+#ifndef CURL_AT_LEAST_VERSION
+#define CURL_AT_LEAST_VERSION(x,y,z) \
+  (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
+#endif /* ! CURL_AT_LEAST_VERSION */
+
 #if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
 #undef MHD_CPU_COUNT
 #endif
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index 8538fb28..51f87598 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -54,6 +54,14 @@
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
 
+#ifndef CURL_VERSION_BITS
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
+#endif /* ! CURL_VERSION_BITS */
+#ifndef CURL_AT_LEAST_VERSION
+#define CURL_AT_LEAST_VERSION(x,y,z) \
+  (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
+#endif /* ! CURL_AT_LEAST_VERSION */
+
 #if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
 #undef MHD_CPU_COUNT
 #endif
@@ -486,8 +494,10 @@ curlEasyInitForTest (struct curlQueryParams *p,
                                      lcurl_hdr_callback)) ||
       (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA,
                                      hdr_chk_result)) ||
+#if CURL_AT_LEAST_VERSION (7, 42, 0)
       (CURLE_OK != curl_easy_setopt (c, CURLOPT_PATH_AS_IS,
                                      (long) 1)) ||
+#endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */
       (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
       (oneone) ?
       (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,

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