gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/02: mhd_sockets: added helper macros


From: gnunet
Subject: [libmicrohttpd] 01/02: mhd_sockets: added helper macros
Date: Sat, 05 Dec 2020 15:46:15 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 964c8e951e22587290d350213eda71e0cfaa954d
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Dec 5 15:58:11 2020 +0300

    mhd_sockets: added helper macros
    
    New macros identify OS network behavior
---
 src/microhttpd/mhd_sockets.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index d7317d4f..e8cabc19 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -122,6 +122,10 @@
 typedef intptr_t ssize_t;
 #endif /* !_SSIZE_T_DEFINED */
 
+#ifdef __FreeBSD__
+#include <sys/param.h> /* For __FreeBSD_version */
+#endif /* __FreeBSD__ */
+
 #include "mhd_limits.h"
 
 #ifdef _MHD_FD_SETSIZE_IS_DEFAULT
@@ -219,15 +223,55 @@ typedef SOCKET MHD_socket;
 #define MHD_TCP_CORK_NOPUSH TCP_NOPUSH
 #endif /* TCP_NOPUSH */
 
+
+#ifdef MHD_TCP_CORK_NOPUSH
+#ifdef __linux__
+/**
+ * Indicate that reset of TCP_CORK / TCP_NOPUSH push data to the network
+ */
+#define _MHD_CORK_RESET_PUSH_DATA 1
+/**
+ * Indicate that reset of TCP_CORK / TCP_NOPUSH push data to the network
+ * even if TCP_CORK/TCP_NOPUSH was in switched off state.
+ */
+#define _MHD_CORK_RESET_PUSH_DATA_ALWAYS 1
+#endif /* __linux__ */
+#if defined(__FreeBSD__) && \
+  ((__FreeBSD__ + 0) >= 5 || (__FreeBSD_version + 0) >= 450000)
+/* FreeBSD pushes data to the network with reset of TCP_NOPUSH
+ * starting from version 4.5. */
+/**
+ * Indicate that reset of TCP_CORK / TCP_NOPUSH push data to the network
+ */
+#define _MHD_CORK_RESET_PUSH_DATA 1
+#endif /* __FreeBSD_version >= 450000 */
+#endif /* MHD_TCP_CORK_NOPUSH */
+
+#ifdef __linux__
+/**
+ * Indicate that set of TCP_NODELAY push data to the network
+ */
+#define _MHD_NODELAY_SET_PUSH_DATA 1
+/**
+ * Indicate that set of TCP_NODELAY push data to the network even
+ * if TCP_DELAY was already set and regardless of TCP_CORK / TCP_NOPUSH state
+ */
+#define _MHD_NODELAY_SET_PUSH_DATA_ALWAYS 1
+#endif /* __linux__ */
+
 #ifdef MSG_MORE
 #ifdef __linux__
 /* MSG_MORE signal kernel to buffer outbond data and works like
  * TCP_CORK per call without actually setting TCP_CORK value.
  * It's known to work on Linux. Add more OSes if they are compatible. */
+/**
+ * Indicate MSG_MORE is usable for buffered send().
+ */
 #define MHD_USE_MSG_MORE 1
 #endif /* __linux__ */
 #endif /* MSG_MORE */
 
+
 /**
  * MHD_SCKT_OPT_BOOL_ is type for bool parameters for setsockopt()/getsockopt()
  */

-- 
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]