lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Found bug in pbuf.c


From: Kieran Mansley
Subject: Re: [lwip-users] Found bug in pbuf.c
Date: Thu, 29 May 2003 16:29:38 +0100 (BST)

On Wed, 28 May 2003, David Haas wrote:
> The general idea is that pbuf->ref should be incremented for each
> reference made to a pbuf. That reference could be a pointer that tcp or
> an application holds or it could be from another pbuf in a chain. The
> operation you describe where a pbuf is chained should result in the
> second pbuf having a ref count of 2 and the first one having a ref count
> of 1. If the application who calls pbuf_chain() does not need to keep a
> pointer to the second pbuf, then it may now safely free it (the second
> pbuf). That is what happens in the tcp_enqueue() code you are
> describing.

I see.  The call to pbuf_free() after pbuf_chain() was what I was missing
in my logic when I suggested that pbuf_dechain() should decrease the
reference count.

My guess is that Guido doesn't have this pbuf_free() call in there, which
is why it's all going wrong for him.

Kieran






reply via email to

[Prev in Thread] Current Thread [Next in Thread]