gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (9ce7aa95 -> 7762278b)


From: gnunet
Subject: [libmicrohttpd] branch master updated (9ce7aa95 -> 7762278b)
Date: Wed, 14 Apr 2021 21:24:24 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 9ce7aa95 Style and shadowing fixes
     new 726b9c47 test_upgrade_large: fixed data race
     new 7762278b mhd_send: use sendmsg() in POSIX-compatible way

The 2 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:
 ChangeLog                           |  4 ++++
 src/microhttpd/mhd_send.c           |  4 ++++
 src/microhttpd/test_upgrade_large.c | 19 +++++++++++--------
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 383eed63..a9318e91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Web 14 Apr 2021 22:20:00 MSK
+    Fixed: use sendmsg() in POSIX-compatible way, do not try to send more
+    than IOV_MAX elements per single call. -EG
+
 Sun 11 Apr 2021 15:44:00 MSK
     Updated test TLS certificates to not expired modern versions, restored
     HTTPS examples compatibility with modern browsers.
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index f3028293..f691cc7d 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -1291,6 +1291,10 @@ send_iov_nontls (struct MHD_Connection *connection,
   pre_send_setopt (connection, true, push_data);
 
   items_to_send = r_iov->cnt - r_iov->sent;
+#ifdef IOV_MAX
+  if (IOV_MAX < items_to_send)
+    items_to_send = IOV_MAX;
+#endif /* IOV_MAX */
 #ifdef HAVE_SENDMSG
   memset (&msg, 0, sizeof(struct msghdr));
   msg.msg_iov = r_iov->iov + r_iov->sent;
diff --git a/src/microhttpd/test_upgrade_large.c 
b/src/microhttpd/test_upgrade_large.c
index 9f1dbaaa..7de8de2d 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -1085,8 +1085,6 @@ run_mhd_select_loop (struct MHD_Daemon *daemon)
   MHD_UNSIGNED_LONG_LONG to;
   struct timeval tv;
 
-  if (! MHD_itc_init_ (kicker))
-    abort ();
   while (! done)
   {
     FD_ZERO (&rs);
@@ -1122,8 +1120,6 @@ run_mhd_select_loop (struct MHD_Daemon *daemon)
                          &ws,
                          &es);
   }
-  (void) MHD_itc_destroy_ (kicker);
-  MHD_itc_set_invalid_ (kicker);
 }
 
 
@@ -1164,8 +1160,6 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
   di = MHD_get_daemon_info (daemon,
                             MHD_DAEMON_INFO_EPOLL_FD);
   ep = di->listen_fd;
-  if (! MHD_itc_init_ (kicker))
-    abort ();
   while (! done)
   {
     FD_ZERO (&rs);
@@ -1191,8 +1185,6 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
       MHD_itc_clear_ (kicker);
     MHD_run (daemon);
   }
-  (void) MHD_itc_destroy_ (kicker);
-  MHD_itc_set_invalid_ (kicker);
 }
 
 
@@ -1329,6 +1321,12 @@ test_upgrade (int flags,
 #endif /* !HTTPS_SUPPORT || !HAVE_FORK || !HAVE_WAITPID */
   }
 
+  if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) )
+  {
+    if (! MHD_itc_init_ (kicker))
+      abort ();
+  }
+
   if (0 != pthread_create (&pt_client,
                            NULL,
                            &run_usock_client,
@@ -1352,6 +1350,11 @@ test_upgrade (int flags,
   if (test_tls && (TLS_LIB_GNUTLS != use_tls_tool))
     waitpid (pid, NULL, 0);
 #endif /* HTTPS_SUPPORT && HAVE_FORK && HAVE_WAITPID */
+  if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) )
+  {
+    (void) MHD_itc_destroy_ (kicker);
+    MHD_itc_set_invalid_ (kicker);
+  }
   MHD_stop_daemon (d);
   return 0;
 }

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