From caf3c1682679c5cf97e00310133eca2c22eb5357 Mon Sep 17 00:00:00 2001 From: kieranm Date: Mon, 8 Mar 2004 14:41:25 +0000 Subject: [PATCH] Kieran Mansley, kjm25@cam.ac.uk, 08th Mar 2004 - added a comment to tcp_recved() to clarify reasons for call to tcp_ack() --- src/core/tcp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/tcp.c b/src/core/tcp.c index f140b96f..357269e5 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -446,6 +446,16 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len) } if (!(pcb->flags & TF_ACK_DELAY) && !(pcb->flags & TF_ACK_NOW)) { + /* + * We send an ACK here (if one is not already pending, hence + * the above tests) as tcp_recved() implies that the application + * has processed some data, and so we can open the receiver's + * window to allow more to be transmitted. This could result in + * two ACKs being sent for each received packet in some limited cases + * (where the application is only receiving data, and is slow to + * process it) but it is necessary to guarantee that the sender can + * continue to transmit. + */ tcp_ack(pcb); }