diff options
author | jayanth <jayanth@FreeBSD.org> | 2001-10-05 21:33:38 +0000 |
---|---|---|
committer | jayanth <jayanth@FreeBSD.org> | 2001-10-05 21:33:38 +0000 |
commit | 3c252600584c9f07e9a9145a104a08e001090d00 (patch) | |
tree | e4fe78cb3f41ec216402bb68c1185cffeae21621 /sys/netinet/tcp_output.c | |
parent | d3e4b82b69037389ddd7149ee65ddac5095efa4d (diff) | |
download | FreeBSD-src-3c252600584c9f07e9a9145a104a08e001090d00.zip FreeBSD-src-3c252600584c9f07e9a9145a104a08e001090d00.tar.gz |
Add a flag TF_LASTIDLE, that forces a previously idle connection
to send all its data, especially when the data is less than one MSS.
This fixes an issue where the stack was delaying the sending
of data, eventhough there was enough window to send all the data and
the sending of data was emptying the socket buffer.
Problem found by Yoshihiro Tsuchiya (tsuchiya@flab.fujitsu.co.jp)
Submitted by: Jayanth Vijayaraghavan
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r-- | sys/netinet/tcp_output.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 2740c72..e473b8e 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -135,7 +135,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 && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { /* * We have been idle for "a while" and no acks are @@ -159,6 +159,13 @@ tcp_output(tp) else tp->snd_cwnd = tp->t_maxseg * ss_fltsz; } + tp->t_flags &= ~TF_LASTIDLE; + if (idle) { + if (tp->t_flags & TF_MORETOCOME) { + tp->t_flags |= TF_LASTIDLE; + idle = 0; + } + } again: sendalot = 0; off = tp->snd_nxt - tp->snd_una; |