gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated (47ec146c -> 08039fcf)


From: gnunet
Subject: [libmicrohttpd] branch master updated (47ec146c -> 08039fcf)
Date: Fri, 04 Dec 2020 09:56:11 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 47ec146c Added missing macro rename
     new 23b704ee mhd_send.c: avoid double checking of parameter
     new 08039fcf mhd_send.c: use wrapper macro for send()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/microhttpd/mhd_send.c    | 23 +++++++++++------------
 src/microhttpd/mhd_sockets.h | 17 ++++++++++++++---
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 891c70b7..eab145bc 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -331,10 +331,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
     return MHD_ERR_NOTCONN_;
   }
 
-  /* from send_param_adapter() */
-  if (buffer_size > MHD_SCKT_SEND_MAX_SIZE_)
-    buffer_size = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
-
   /* Get socket options, change/set options if necessary. */
   switch (options)
   {
@@ -387,16 +383,19 @@ MHD_send_on_connection_ (struct MHD_Connection 
*connection,
   else
   {
     /* plaintext transmission */
+    if (buffer_size > MHD_SCKT_SEND_MAX_SIZE_)
+      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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]