diff options
| author | 2004-09-16 13:14:28 +0000 | |
|---|---|---|
| committer | 2004-09-16 13:14:28 +0000 | |
| commit | 05554db29595479076afd36bb87d6164864e6a6e (patch) | |
| tree | 9bf7e9636b9cd8a4c83fb8e258a6ca0bdd6ea7c2 /sys/netinet/tcp_output.c | |
| parent | add hint for lower layer that a sosend() is in progress (SS_ISSENDING) (diff) | |
| download | wireguard-openbsd-05554db29595479076afd36bb87d6164864e6a6e.tar.xz wireguard-openbsd-05554db29595479076afd36bb87d6164864e6a6e.zip | |
don't send partial segments if SS_ISSENDING is set, remember
TF_LASTIDLE across invocations of tcp_output (from freebsd);
ok mcbride
Diffstat (limited to 'sys/netinet/tcp_output.c')
| -rw-r--r-- | sys/netinet/tcp_output.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index c9f7df5c495..8cd394c8db1 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.71 2004/06/20 18:16:50 itojun Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.72 2004/09/16 13:14:28 markus Exp $ */ /* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* @@ -241,7 +241,7 @@ tcp_output(tp) * If there is some data or critical controls (SYN, RST) * to send, then transmit; otherwise, investigate further. */ - idle = (tp->snd_max == tp->snd_una); + idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); if (idle && (tcp_now - tp->t_rcvtime) >= tp->t_rxtcur) /* * We have been idle for "a while" and no acks are @@ -249,6 +249,14 @@ tcp_output(tp) * slow start to get ack "clock" running again. */ tp->snd_cwnd = tp->t_maxseg; + + /* remember 'idle' for next invocation of tcp_output */ + if (idle && soissending(so)) { + tp->t_flags |= TF_LASTIDLE; + idle = 0; + } else + tp->t_flags &= ~TF_LASTIDLE; + again: #ifdef TCP_SACK /* @@ -404,7 +412,7 @@ again: if (len == txmaxseg) goto send; if ((idle || tp->t_flags & TF_NODELAY) && - len + off >= so->so_snd.sb_cc) + len + off >= so->so_snd.sb_cc && !soissending(so)) goto send; if (tp->t_force) goto send; @@ -728,7 +736,7 @@ send: * give data to the user when a buffer fills or * a PUSH comes in.) */ - if (off + len == so->so_snd.sb_cc) + if (off + len == so->so_snd.sb_cc && !soissending(so)) flags |= TH_PUSH; } else { if (tp->t_flags & TF_ACKNOW) |
