From 45a3f198e8c7750c66e311b7adca700977f79648 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 22 Sep 2011 18:50:18 +0200 Subject: [PATCH] fixed bug #34355: nagle does not take snd_buf/snd_queuelen into account --- CHANGELOG | 4 ++++ src/include/lwip/tcp_impl.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 688b6a15..ef25485b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -45,6 +45,10 @@ HISTORY ++ Bugfixes: + 2011-09-22: Simon Goldschmidt + * tcp_impl.h: fixed bug #34355: nagle does not take snd_buf/snd_queuelen into + account + 2011-09-21: Simon Goldschmidt * opt.h: fixed default value of TCP_SND_BUF to not violate the sanity checks in init.c diff --git a/src/include/lwip/tcp_impl.h b/src/include/lwip/tcp_impl.h index c80afc62..2ee8b764 100644 --- a/src/include/lwip/tcp_impl.h +++ b/src/include/lwip/tcp_impl.h @@ -83,7 +83,8 @@ u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb); #define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \ (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \ - ((tpcb)->unsent->len >= (tpcb)->mss))) \ + ((tpcb)->unsent->len >= (tpcb)->mss))) || \ + ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \ ) ? 1 : 0) #define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK)