mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user