aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-02-23 21:40:00 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-02-24 19:46:31 +0300
commitf85f859219ab76b8d2c6a894d7d67ac19656bf9d (patch)
tree81ba5b525cb7797c179c86e1f2e58db1e6a84f22
parenta22b8cdf03889885c9a0d30fef9d5233a97ede35 (diff)
downloadlibmicrohttpd-f85f859219ab76b8d2c6a894d7d67ac19656bf9d.tar.gz
libmicrohttpd-f85f859219ab76b8d2c6a894d7d67ac19656bf9d.zip
mhd_send: use MSG_MORE for iovec
-rw-r--r--src/microhttpd/mhd_send.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index c2cded87..f3028293 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -1288,7 +1288,7 @@ send_iov_nontls (struct MHD_Connection *connection,
1288 return MHD_ERR_NOTCONN_; 1288 return MHD_ERR_NOTCONN_;
1289 } 1289 }
1290 1290
1291 pre_send_setopt (connection, false, push_data); 1291 pre_send_setopt (connection, true, push_data);
1292 1292
1293 items_to_send = r_iov->cnt - r_iov->sent; 1293 items_to_send = r_iov->cnt - r_iov->sent;
1294#ifdef HAVE_SENDMSG 1294#ifdef HAVE_SENDMSG
@@ -1296,7 +1296,12 @@ send_iov_nontls (struct MHD_Connection *connection,
1296 msg.msg_iov = r_iov->iov + r_iov->sent; 1296 msg.msg_iov = r_iov->iov + r_iov->sent;
1297 msg.msg_iovlen = items_to_send; 1297 msg.msg_iovlen = items_to_send;
1298 1298
1299#ifdef MHD_USE_MSG_MORE
1300 res = sendmsg (connection->socket_fd, &msg,
1301 MSG_NOSIGNAL_OR_ZERO | (push_data ? 0 : MSG_MORE));
1302#else /* ! MHD_USE_MSG_MORE */
1299 res = sendmsg (connection->socket_fd, &msg, MSG_NOSIGNAL_OR_ZERO); 1303 res = sendmsg (connection->socket_fd, &msg, MSG_NOSIGNAL_OR_ZERO);
1304#endif /* ! MHD_USE_MSG_MORE */
1300#elif defined(HAVE_WRITEV) 1305#elif defined(HAVE_WRITEV)
1301 res = writev (connection->socket_fd, r_iov->iov + r_iov->sent, 1306 res = writev (connection->socket_fd, r_iov->iov + r_iov->sent,
1302 items_to_send); 1307 items_to_send);
@@ -1349,7 +1354,7 @@ send_iov_nontls (struct MHD_Connection *connection,
1349 } 1354 }
1350 1355
1351 if (r_iov->cnt == r_iov->sent) 1356 if (r_iov->cnt == r_iov->sent)
1352 post_send_setopt (connection, false, push_data); 1357 post_send_setopt (connection, true, push_data);
1353 else 1358 else
1354 { 1359 {
1355#ifdef EPOLL_SUPPORT 1360#ifdef EPOLL_SUPPORT