diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-02-02 18:48:25 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-02-02 18:48:25 +0000 |
commit | 8d293e58ce93b9bb64479e5832c1847bf043d360 (patch) | |
tree | 038fc9414f1274ee16376e85f96990faeb8f428d /sys | |
parent | 766147079e4ff2bb1db546b8a4a0fc99e025556e (diff) | |
download | FreeBSD-src-8d293e58ce93b9bb64479e5832c1847bf043d360.zip FreeBSD-src-8d293e58ce93b9bb64479e5832c1847bf043d360.tar.gz |
When turning off TCP_NOPUSH, call tcp_output to immediately flush
out any data pending in the buffer.
Submitted by: Tony Finch <dot@dotat.at>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 6feb666..ac1eee9 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -895,7 +895,6 @@ tcp_ctloutput(so, sopt) switch (sopt->sopt_name) { case TCP_NODELAY: case TCP_NOOPT: - case TCP_NOPUSH: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -908,9 +907,6 @@ tcp_ctloutput(so, sopt) case TCP_NOOPT: opt = TF_NOOPT; break; - case TCP_NOPUSH: - opt = TF_NOPUSH; - break; default: opt = 0; /* dead code to fool gcc */ break; @@ -922,6 +918,20 @@ tcp_ctloutput(so, sopt) tp->t_flags &= ~opt; break; + case TCP_NOPUSH: + error = sooptcopyin(sopt, &optval, sizeof optval, + sizeof optval); + if (error) + break; + + if (optval) + tp->t_flags |= TF_NOPUSH; + else { + tp->t_flags &= ~TF_NOPUSH; + error = tcp_output(tp); + } + break; + case TCP_MAXSEG: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); |