summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c16
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)