When turning off TCP_NOPUSH, only call tcp_output() to immediately flush

any pending data if the connection is established.

Submitted by:	csjp
Reviewed by:	lstewart
MFC after:	1 week
This commit is contained in:
John Baldwin 2011-02-04 14:13:15 +00:00
parent 5e86ca0084
commit d28b9e89a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218271

View File

@ -1328,9 +1328,10 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
INP_WLOCK_RECHECK(inp);
if (optval)
tp->t_flags |= TF_NOPUSH;
else {
else if (tp->t_flags & TF_NOPUSH) {
tp->t_flags &= ~TF_NOPUSH;
error = tcp_output(tp);
if (TCPS_HAVEESTABLISHED(tp->t_state))
error = tcp_output(tp);
}
INP_WUNLOCK(inp);
break;