summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /net/ipv4/tcp_timer.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 94275718b..ea46d3268 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -5,7 +5,7 @@
*
* Implementation of the Transmission Control Protocol(TCP).
*
- * Version: $Id: tcp_timer.c,v 1.51 1998/05/02 15:19:26 davem Exp $
+ * Version: $Id: tcp_timer.c,v 1.55 1998/11/07 11:55:42 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -183,8 +183,8 @@ void tcp_probe_timer(unsigned long data)
return;
if (atomic_read(&sk->sock_readers)) {
- /* Try again in second. */
- tcp_reset_xmit_timer(sk, TIME_PROBE0, HZ);
+ /* Try again later. */
+ tcp_reset_xmit_timer(sk, TIME_PROBE0, HZ/5);
return;
}
@@ -229,6 +229,9 @@ static __inline__ int tcp_keepopen_proc(struct sock *sk)
sk->err = ETIMEDOUT;
tcp_set_state(sk, TCP_CLOSE);
+ sk->shutdown = SHUTDOWN_MASK;
+ if (!sk->dead)
+ sk->state_change(sk);
} else {
tp->probes_out++;
tp->pending = TIME_KEEPOPEN;
@@ -433,8 +436,8 @@ void tcp_retransmit_timer(unsigned long data)
}
if (atomic_read(&sk->sock_readers)) {
- /* Try again in a second. */
- tcp_reset_xmit_timer(sk, TIME_RETRANS, HZ);
+ /* Try again later */
+ tcp_reset_xmit_timer(sk, TIME_RETRANS, HZ/20);
return;
}
lock_sock(sk);
@@ -463,11 +466,16 @@ void tcp_retransmit_timer(unsigned long data)
tp->fackets_out = 0;
tp->retrans_out = 0;
if (tp->retransmits == 0) {
- /* remember window where we lost
+ /* Remember window where we lost:
* "one half of the current window but at least 2 segments"
+ *
+ * Here "current window" means the effective one, which
+ * means it must be an accurate representation of our current
+ * sending rate _and_ the snd_wnd.
*/
- tp->snd_ssthresh = max(tp->snd_cwnd >> (1 + TCP_CWND_SHIFT), 2);
- tp->snd_cwnd = (1 << TCP_CWND_SHIFT);
+ tp->snd_ssthresh = max(min(tp->snd_wnd, tp->snd_cwnd) >> 1, 2);
+ tp->snd_cwnd_cnt = 0;
+ tp->snd_cwnd = 1;
}
tp->retransmits++;