[MEDIUM] remove TCP_CORK and make use of MSG_MORE instead
send() supports the MSG_MORE flag on Linux, which does the same
as TCP_CORK except that we don't have to remove TCP_NODELAY before
and we don't need any syscall to set/remove it. This can save up
to 4 syscalls around a send() (two for setting it, two for removing
it), and it's much cleaner since it is not persistent. So make use
of it instead.
diff --git a/include/common/compat.h b/include/common/compat.h
index dec5d7d..8ddb72d 100644
--- a/include/common/compat.h
+++ b/include/common/compat.h
@@ -66,6 +66,11 @@
#define MSG_DONTWAIT 0
#endif
+/* Only Linux defines MSG_MORE */
+#ifndef MSG_MORE
+#define MSG_MORE 0
+#endif
+
#if defined(TPROXY) && defined(NETFILTER)
#include <linux/types.h>
#include <linux/netfilter_ipv6.h>
diff --git a/include/types/fd.h b/include/types/fd.h
index a50d076..3ab89fe 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -63,8 +63,7 @@
*/
#define FD_FL_TCP 0x0001 /* socket is TCP */
#define FD_FL_TCP_NODELAY 0x0002
-#define FD_FL_TCP_CORK 0x0004
-#define FD_FL_TCP_NOLING 0x0008 /* lingering disabled */
+#define FD_FL_TCP_NOLING 0x0004 /* lingering disabled */
/* info about one given fd */
struct fdtab {