[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: mhd_send: use sendmsg() in POSIX-compatible way
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: mhd_send: use sendmsg() in POSIX-compatible way |
Date: |
Wed, 14 Apr 2021 21:24:26 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 7762278bd16a304715b086f5709e8671c4f5a9ec
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Apr 14 22:21:32 2021 +0300
mhd_send: use sendmsg() in POSIX-compatible way
Some OSes may have limit on number of maximum elements per single
call of sendmsg()/writev(). Do not try to send more elements than
allowed by OS.
---
ChangeLog | 4 ++++
src/microhttpd/mhd_send.c | 4 ++++
2 files changed, 8 insertions(+)
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;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.