[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/06: mhd_send: re-use MHD_VECT_SEND macro
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/06: mhd_send: re-use MHD_VECT_SEND macro |
Date: |
Wed, 24 Feb 2021 17:48:48 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit a22b8cdf03889885c9a0d30fef9d5233a97ede35
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Feb 23 17:35:49 2021 +0300
mhd_send: re-use MHD_VECT_SEND macro
---
src/microhttpd/mhd_send.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index fd67300c..c2cded87 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -782,10 +782,6 @@ MHD_send_data_ (struct MHD_Connection *connection,
}
-#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV) || defined(_WIN32)
-#define _MHD_USE_SEND_VEC 1
-#endif /* HAVE_SENDMSG || HAVE_WRITEV || _WIN32*/
-
ssize_t
MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
const char *header,
@@ -804,7 +800,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
#else /* ! _WIN32 */
#define _MHD_SEND_VEC_MAX UINT32_MAX
#endif /* ! _WIN32 */
-#ifdef _MHD_USE_SEND_VEC
+#ifdef MHD_VECT_SEND
#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV)
struct iovec vector[2];
#ifdef HAVE_SENDMSG
@@ -829,7 +825,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
#endif /* (!HAVE_SENDMSG || ! MSG_NOSIGNAL) &&
MHD_SEND_SPIPE_SEND_SUPPRESS_POSSIBLE &&
MHD_SEND_SPIPE_SUPPRESS_NEEDED */
-#endif /* _MHD_USE_SEND_VEC */
+#endif /* MHD_VECT_SEND */
mhd_assert ( (NULL != body) || (0 == body_size) );
@@ -866,7 +862,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
push_hdr = true; /* The header alone is equal to the whole response. */
if (
-#ifdef _MHD_USE_SEND_VEC
+#ifdef MHD_VECT_SEND
(no_vec) ||
(0 == body_size) ||
((size_t) SSIZE_MAX <= header_size) ||
@@ -874,9 +870,9 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
#ifdef _WIN32
|| ((size_t) UINT_MAX < header_size)
#endif /* _WIN32 */
-#else /* ! _MHD_USE_SEND_VEC */
+#else /* ! MHD_VECT_SEND */
true
-#endif /* ! _MHD_USE_SEND_VEC */
+#endif /* ! MHD_VECT_SEND */
)
{
ret = MHD_send_data_ (connection,
@@ -915,7 +911,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
}
return ret;
}
-#ifdef _MHD_USE_SEND_VEC
+#ifdef MHD_VECT_SEND
if ( ((size_t) SSIZE_MAX <= body_size) ||
((size_t) SSIZE_MAX < (header_size + body_size)) )
@@ -1040,10 +1036,10 @@ MHD_send_hdr_and_body_ (struct MHD_Connection
*connection,
}
return ret;
-#else /* ! _MHD_USE_SEND_VEC */
+#else /* ! MHD_VECT_SEND */
mhd_assert (false);
return MHD_ERR_CONNRESET_; /* Unreachable. Mute warnings. */
-#endif /* ! _MHD_USE_SEND_VEC */
+#endif /* ! MHD_VECT_SEND */
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (bb2e08b6 -> 22752968), gnunet, 2021/02/24
- [libmicrohttpd] 01/06: SIGPIPE macros minor refactoring, gnunet, 2021/02/24
- [libmicrohttpd] 05/06: Bump MHD_VERSION, gnunet, 2021/02/24
- [libmicrohttpd] 06/06: ChangeLog updated, gnunet, 2021/02/24
- [libmicrohttpd] 04/06: mhd_send: use MSG_MORE for iovec, gnunet, 2021/02/24
- [libmicrohttpd] 03/06: mhd_send: re-use MHD_VECT_SEND macro,
gnunet <=
- [libmicrohttpd] 02/06: Implemented new function MHD_create_response_from_iovec(), gnunet, 2021/02/24