From 24e29cecaef3f25bef7a195deb4b92a9481f7a69 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 28 Jun 2007 20:05:38 +0000 Subject: [PATCH] Fixed bug #20287: Fixed nagle algorithm (sending was done too early if a segment contained chained pbufs) --- CHANGELOG | 4 ++++ src/include/lwip/tcp.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4ea5aa75..44695236 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -238,6 +238,10 @@ HISTORY ++ Bug fixes: + 2007-06-28 Simon Goldschmidt + * tcp.h: Fixed bug #20287: Fixed nagle algorithm (sending was done too early if + a segment contained chained pbufs) + 2007-06-28 Frédéric Bernon * autoip.c: replace most of rand() calls by a macro LWIP_AUTOIP_RAND which compute a "pseudo-random" value based on netif's MAC and some autoip fields. It's always diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 16e75696..668800ad 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -119,7 +119,7 @@ void tcp_rexmit_rto (struct tcp_pcb *pcb); */ #define tcp_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ ((tpcb)->flags & TF_NODELAY) || \ - ((tpcb)->snd_queuelen > 1)) ? \ + (((tpcb)->unsent != NULL) && ((tpcb)->unsent->next != NULL))) ? \ tcp_output(tpcb) : ERR_OK)