mhd_send.c: use wrapper macro for send()

This commit is contained in:
Evgeny Grin (Karlson2k) committed 2020-12-04 11:55:38 +03:00
1 parent 23b704ee3d
commit 08039fcf03
2 files changed
+23 -12

No files matched your search

+8 -8
View File
@@ -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)
+15 -4
View File
@@ -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_send4_(s,b,l,f) \
((ssize_t) send ((s),(const void*) (b),(MHD_SCKT_SEND_SIZE_) (l), \
((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) \
((ssize_t) send ((s),(const void*) (b),(MHD_SCKT_SEND_SIZE_) (l), \
MSG_NOSIGNAL_OR_ZERO))
#define MHD_send_(s,b,l) MHD_send4_((s),(b),(l), 0)
/**