From: Ben Gras Date: Thu, 4 Feb 2010 22:05:17 +0000 (+0000) Subject: philip's inet tcp fix X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=f1aaf14cb31b3994eba98882169c1ac1e1c45910;p=minix.git philip's inet tcp fix --- diff --git a/servers/inet/generic/tcp_send.c b/servers/inet/generic/tcp_send.c index 793cbcd0b..a10cf8aa5 100644 --- a/servers/inet/generic/tcp_send.c +++ b/servers/inet/generic/tcp_send.c @@ -540,7 +540,7 @@ u16_t new_win; acc_t *pack; clock_t retrans_time, curr_time, rtt, artt, drtt, srtt; u32_t queue_lo, queue_hi; - u16_t mss, cthresh; + u16_t mss, cthresh, new_cthresh; unsigned window; DBLOCK(0x10, printf("tcp_release_retrans, conn[%d]: ack %lu, win %u\n", @@ -640,9 +640,11 @@ u16_t new_win; cthresh= tcp_conn->tc_snd_cthresh; if (window > cthresh) { - cthresh += tcp_conn->tc_snd_cinc; - tcp_conn->tc_snd_cthresh= cthresh; - window= cthresh; + new_cthresh= cthresh + tcp_conn->tc_snd_cinc; + if (new_cthresh < cthresh) + new_cthresh= cthresh; /* overflow */ + tcp_conn->tc_snd_cthresh= new_cthresh; + window= new_cthresh; } /* If the window is larger than the window advertised by the