From f4a9d173a13e663b799dab01d6d6a5ac5cf1a8af Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 10 Jan 2010 11:41:25 +0000 Subject: [PATCH] bug #28127: remove call to tcp_output() from tcp_ack(_now)() --- CHANGELOG | 3 +++ src/core/tcp.c | 5 ++++- src/include/lwip/tcp.h | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b2298bf8..1848352e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,6 +37,9 @@ HISTORY ++ Bugfixes: + 2010-01-10: Simon Goldschmidt + * tcp.h/.c: bug #28127 (remove call to tcp_output() from tcp_ack(_now)()) + 2010-01-08: Simon Goldschmidt * api_msg.h/.c, api_lib.c: Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox diff --git a/src/core/tcp.c b/src/core/tcp.c index 074e7df3..d4444037 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -454,8 +454,10 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len) * watermark is TCP_WND/2), then send an explicit update now. * Otherwise wait for a packet to be sent in the normal course of * events (or more window to be available later) */ - if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) + if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) { tcp_ack_now(pcb); + tcp_output(pcb); + } LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n", len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd)); @@ -836,6 +838,7 @@ tcp_fasttmr(void) if (pcb->flags & TF_ACK_DELAY) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n")); tcp_ack_now(pcb); + tcp_output(); pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); } } diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 661d2ec6..e70e9b73 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -556,7 +556,6 @@ struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); if((pcb)->flags & TF_ACK_DELAY) { \ (pcb)->flags &= ~TF_ACK_DELAY; \ (pcb)->flags |= TF_ACK_NOW; \ - tcp_output(pcb); \ } \ else { \ (pcb)->flags |= TF_ACK_DELAY; \ @@ -566,7 +565,6 @@ struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); #define tcp_ack_now(pcb) \ do { \ (pcb)->flags |= TF_ACK_NOW; \ - tcp_output(pcb); \ } while (0) err_t tcp_send_ctrl(struct tcp_pcb *pcb, u8_t flags);