commit ee8b31980686e127a36684073a5d411c7657671d
parent 526de1a8e1da6a1e5509bd12775c7a1795370bc8
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 13 Dec 2020 17:39:08 +0300
MHD_send_hdr_and_body_: deduplicated code
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
@@ -928,20 +928,17 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
vector[1].iov_len = body_size;
#if HAVE_SENDMSG
- memset (&msg, 0, sizeof(struct msghdr));
+ memset (&msg, 0, sizeof(msg));
msg.msg_iov = vector;
msg.msg_iovlen = 2;
ret = sendmsg (s, &msg, MSG_NOSIGNAL_OR_ZERO);
- if ( (-1 == ret) &&
- (EAGAIN == errno) )
- return MHD_ERR_AGAIN_;
#elif HAVE_WRITEV
ret = writev (s, vector, 2);
+#endif
if ( (-1 == ret) &&
(EAGAIN == errno) )
return MHD_ERR_AGAIN_;
-#endif
/* If there is a need to push the data from network buffers
* call post_send_setopt(). */