From 8be76ed450caeefeefa0a186d15ed8383b43cad7 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 25 Jul 2007 08:46:41 +0000 Subject: [PATCH] tcp_enqueue: pcb->snd_queuelen didn't work for chaine PBUF_RAMs: changed snd_queuelen++ to snd_queuelen += pbuf_clen(p). --- CHANGELOG | 4 ++++ src/core/tcp_out.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 168527ac..e7218952 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -252,6 +252,10 @@ HISTORY ++ Bug fixes: + 2007-07-25 Simon Goldschmidt + * tcp_out.c: tcp_enqueue: pcb->snd_queuelen didn't work for chaine PBUF_RAMs: + changed snd_queuelen++ to snd_queuelen += pbuf_clen(p). + 2007-07-24 Simon Goldschmidt * api_msg.c, tcp.c: Fix bug #20480: Check the pcb passed to tcp_listen() for the correct state (must be CLOSED). diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 812bb80b..266f8950 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -216,7 +216,7 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len, } LWIP_ASSERT("check that first pbuf can hold optlen", (seg->p->len >= optlen)); - ++queuelen; + queuelen += pbuf_clen(seg->p); seg->dataptr = seg->p->payload; } /* copy from volatile memory? */ @@ -227,7 +227,7 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len, } LWIP_ASSERT("check that first pbuf can hold the complete seglen", (seg->p->len >= seglen)); - ++queuelen; + queuelen += pbuf_clen(seg->p); if (arg != NULL) { MEMCPY(seg->p->payload, ptr, seglen); } @@ -257,7 +257,7 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len, LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for header pbuf\n")); goto memerr; } - ++queuelen; + queuelen += pbuf_clen(seg->p); /* Concatenate the headers and data pbufs together. */ pbuf_cat(seg->p/*header*/, p/*data*/);