[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: mhd_send.c: use wrapper macro for send()
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: mhd_send.c: use wrapper macro for send() |
Date: |
Fri, 04 Dec 2020 09:56:13 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 08039fcf03c18b54628253b2a933e6fd1e089dbb
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Dec 4 11:55:38 2020 +0300
mhd_send.c: use wrapper macro for send()
---
src/microhttpd/mhd_send.c | 16 ++++++++--------
src/microhttpd/mhd_sockets.h | 17 ++++++++++++++---
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index db88a5d5..eab145bc 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -387,15 +387,15 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
buffer_size = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
#ifdef MHD_USE_MSG_MORE
- ret = send (s,
- buffer,
- buffer_size,
- MSG_NOSIGNAL_OR_ZERO | (push_data ? 0 : MSG_MORE));
+ ret = MHD_send4_ (s,
+ buffer,
+ buffer_size,
+ push_data ? 0 : MSG_MORE);
#else
- ret = send (connection->socket_fd,
- buffer,
- buffer_size,
- MSG_NOSIGNAL_OR_ZERO);
+ ret = MHD_send4_ (s,
+ buffer,
+ buffer_size,
+ 0);
#endif
if (0 > ret)
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index 25286e5e..d7317d4f 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -284,15 +284,26 @@ typedef int MHD_SCKT_SEND_SIZE_;
/**
- * MHD_send_ is wrapper for system's send()
+ * MHD_send4_ is a wrapper for system's send()
* @param s the socket to use
* @param b the buffer with data to send
* @param l the length of data in @a b
+ * @param f the additional flags
* @return ssize_t type value
*/
-#define MHD_send_(s,b,l) \
+#define MHD_send4_(s,b,l,f) \
((ssize_t) send ((s),(const void*) (b),(MHD_SCKT_SEND_SIZE_) (l), \
- MSG_NOSIGNAL_OR_ZERO))
+ ((MSG_NOSIGNAL_OR_ZERO) | (f))))
+
+
+/**
+ * MHD_send_ is a simple wrapper for system's send()
+ * @param s the socket to use
+ * @param b the buffer with data to send
+ * @param l the length of data in @a b
+ * @return ssize_t type value
+ */
+#define MHD_send_(s,b,l) MHD_send4_((s),(b),(l), 0)
/**
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.