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:
parent
5e86ca0084
commit
d28b9e89a9
@ -1328,9 +1328,10 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
|
|||||||
INP_WLOCK_RECHECK(inp);
|
INP_WLOCK_RECHECK(inp);
|
||||||
if (optval)
|
if (optval)
|
||||||
tp->t_flags |= TF_NOPUSH;
|
tp->t_flags |= TF_NOPUSH;
|
||||||
else {
|
else if (tp->t_flags & TF_NOPUSH) {
|
||||||
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);
|
INP_WUNLOCK(inp);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user