gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (a55b52f0 -> 1683a563)


From: gnunet
Subject: [libmicrohttpd] branch master updated (a55b52f0 -> 1683a563)
Date: Fri, 23 Apr 2021 17:08:45 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from a55b52f0 test_upgrade{,_large}: removed use on unportable function
     new 70a4aff1 daemon: fixed build without HTTPS
     new ba5174d4 Fixed build with MSVC, fixed compiler warnings
     new 4049caeb Fixed build without poll()
     new fa3e94dd Fixed compiler warnings on x32
     new 1683a563 Fixed compiler warning

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/daemon.c   | 12 +++++++++++-
 src/microhttpd/internal.h |  3 +++
 src/microhttpd/mhd_send.c |  2 +-
 src/microhttpd/mhd_send.h |  2 +-
 src/microhttpd/response.c |  8 ++++----
 5 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index ad3bd7a7..5e7bd384 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5143,11 +5143,17 @@ MHD_run_wait (struct MHD_Daemon *daemon,
 
   if (0 > millisec)
     millisec = -1;
-  if (0 != (daemon->options & MHD_USE_POLL))
+  if (false)
+  {
+    (void) 0; /* Mute compiler warning */
+  }
+#ifdef HAVE_POLL
+  else if (0 != (daemon->options & MHD_USE_POLL))
   {
     res = MHD_poll_all (daemon, millisec);
     MHD_cleanup_connections (daemon);
   }
+#endif /* HAVE_POLL */
 #ifdef EPOLL_SUPPORT
   else if (0 != (daemon->options & MHD_USE_EPOLL))
   {
@@ -6079,8 +6085,12 @@ parse_options_va (struct MHD_Daemon *daemon,
       }
       break;
     case MHD_OPTION_TLS_NO_ALPN:
+#ifdef HTTPS_SUPPORT
       daemon->disable_alpn = (va_arg (ap,
                                       int) != 0);
+#else  /* ! HTTPS_SUPPORT */
+      (void) va_arg (ap, int);
+#endif /* ! HTTPS_SUPPORT */
 #ifdef HAVE_MESSAGES
       if (0 == (daemon->options & MHD_USE_TLS))
         MHD_DLOG (daemon,
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index f660dff1..346001c3 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -357,6 +357,7 @@ typedef struct _MHD_W32_iovec
   char *iov_base;
 } MHD_iovec_;
 #define MHD_IOV_ELMN_MAX_SIZE    ULONG_MAX
+typedef unsigned long MHD_iov_size_;
 #elif defined(HAVE_SENDMSG) || defined(HAVE_WRITEV)
 /**
  * Internally used I/O vector type for use when writev or sendmsg
@@ -364,6 +365,7 @@ typedef struct _MHD_W32_iovec
  */
 typedef struct iovec MHD_iovec_;
 #define MHD_IOV_ELMN_MAX_SIZE    SIZE_MAX
+typedef size_t MHD_iov_size_;
 #else
 /**
  * Internally used I/O vector type for use when writev or sendmsg
@@ -371,6 +373,7 @@ typedef struct iovec MHD_iovec_;
  */
 typedef struct MHD_IoVec MHD_iovec_;
 #define MHD_IOV_ELMN_MAX_SIZE    SIZE_MAX
+typedef size_t MHD_iov_size_;
 #endif
 
 
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index a69fbd07..ffba5b95 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -1511,7 +1511,7 @@ send_iov_nontls (struct MHD_Connection *connection,
       /* 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);
-      r_iov->iov[r_iov->sent].iov_len -= res;
+      r_iov->iov[r_iov->sent].iov_len -= (MHD_iov_size_) res;
     }
   }
 
diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h
index 3d440b84..1b2ad6a3 100644
--- a/src/microhttpd/mhd_send.h
+++ b/src/microhttpd/mhd_send.h
@@ -156,7 +156,7 @@ MHD_connection_set_cork_state_ (struct MHD_Connection 
*connection,
  */
 ssize_t
 MHD_send_iovec_ (struct MHD_Connection *connection,
-                 struct MHD_iovec_track_ *r_iov,
+                 struct MHD_iovec_track_ *const r_iov,
                  bool push_data);
 
 
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 8c047077..cc0cd38b 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -941,7 +941,7 @@ MHD_create_response_from_iovec (const struct MHD_IoVec *iov,
   {
     mhd_assert (NULL != last_valid_buffer);
     response->data = (void *) last_valid_buffer;
-    response->data_size = total_size;
+    response->data_size = (size_t) total_size;
     return response;
   }
   mhd_assert (1 < i_cp);
@@ -961,12 +961,12 @@ MHD_create_response_from_iovec (const struct MHD_IoVec 
*iov,
     for (i = 0; i < iovcnt; ++i)
     {
       size_t element_size = iov[i].iov_len;
-      const void *buf = iov[i].iov_base;
+      const uint8_t *buf = (const uint8_t *) iov[i].iov_base;
 
       if (0 == element_size)
         continue;         /* skip zero-sized elements */
 #if defined(MHD_WINSOCK_SOCKETS) && defined(_WIN64)
-      while (ULONG_MAX < element_size)
+      while (MHD_IOV_ELMN_MAX_SIZE < element_size)
       {
         iov_copy[i_cp].iov_base = (char *) buf;
         iov_copy[i_cp].iov_len = ULONG_MAX;
@@ -976,7 +976,7 @@ MHD_create_response_from_iovec (const struct MHD_IoVec *iov,
       }
 #endif /* MHD_WINSOCK_SOCKETS && _WIN64 */
       iov_copy[i_cp].iov_base = (void *) buf;
-      iov_copy[i_cp].iov_len = element_size;
+      iov_copy[i_cp].iov_len = (MHD_iov_size_) element_size;
       i_cp++;
     }
     mhd_assert (num_copy_elements == i_cp);

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