From 6f00cbb6ef5babba9145f50ed02bd50670f86e65 Mon Sep 17 00:00:00 2001 From: kieranm Date: Tue, 15 Jan 2008 13:00:51 +0000 Subject: [PATCH] 2008-01-15 Kieran Mansley * tcp_out.c: BUG20511. Modify persist timer to start when we are prevented from sending by a small send window, not just a zero send window. --- CHANGELOG | 6 ++++++ src/core/tcp_out.c | 18 +++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ca190ea8..baf194af 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -592,6 +592,12 @@ HISTORY ++ Bug fixes: + + 2008-01-15 Kieran Mansley + * tcp_out.c: BUG20511. Modify persist timer to start when we are + prevented from sending by a small send window, not just a zero + send window. + 2008-01-09 Jonathan Larmour * opt.h, ip.c: Rename IP_OPTIONS define to IP_OPTIONS_ALLOWED to avoid conflict with Linux system headers. diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index c80e637b..c46e4b85 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -510,11 +510,7 @@ tcp_output(struct tcp_pcb *pcb) ntohl(seg->tcphdr->seqno), pcb->lastack)); } #endif /* TCP_CWND_DEBUG */ - if (seg != NULL && pcb->snd_wnd == 0 && pcb->persist_backoff == 0) { - /* prepare for persist timer */ - pcb->persist_cnt = 0; - pcb->persist_backoff = 1; - } /* data available and window allows it to be sent? */ + /* data available and window allows it to be sent? */ while (seg != NULL && ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { LWIP_ASSERT("RST not expected here!", @@ -579,8 +575,16 @@ tcp_output(struct tcp_pcb *pcb) } seg = pcb->unsent; } - pcb->flags &= ~TF_NAGLEMEMERR; - return ERR_OK; + + if (seg != NULL && pcb->persist_backoff == 0 && + ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > pcb->snd_wnd) { + /* prepare for persist timer */ + pcb->persist_cnt = 0; + pcb->persist_backoff = 1; + } + + pcb->flags &= ~TF_NAGLEMEMERR; + return ERR_OK; } /**