summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2013-08-12 21:57:16 +0000
committerbluhm <bluhm@openbsd.org>2013-08-12 21:57:16 +0000
commit2841e731ab41d0d753bed8d175cc66233e5040a4 (patch)
treeabd0d2fdbed5f3cf2689ccfbf4f2a23b50b97e62 /sys/netinet/tcp_output.c
parentThe ps flags are split between thread and process. It is useful (diff)
downloadwireguard-openbsd-2841e731ab41d0d753bed8d175cc66233e5040a4.tar.xz
wireguard-openbsd-2841e731ab41d0d753bed8d175cc66233e5040a4.zip
Add the TCP socket option TCP_NOPUSH to delay sending the stream.
This is useful to aggregate data in the kernel from multiple sources like writes and socket splicing. It avoids sending small packets. From FreeBSD via David Hill; OK mikeb@ henning@
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index c5cd8a8eaec..9d5b469a51f 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_output.c,v 1.98 2013/06/03 16:57:06 bluhm Exp $ */
+/* $OpenBSD: tcp_output.c,v 1.99 2013/08/12 21:57:16 bluhm Exp $ */
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
/*
@@ -415,8 +415,9 @@ again:
if (len) {
if (len == txmaxseg)
goto send;
- if ((idle || tp->t_flags & TF_NODELAY) &&
- len + off >= so->so_snd.sb_cc && !soissending(so))
+ if ((idle || (tp->t_flags & TF_NODELAY)) &&
+ len + off >= so->so_snd.sb_cc && !soissending(so) &&
+ (tp->t_flags & TF_NOPUSH) == 0)
goto send;
if (tp->t_force)
goto send;