lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Freeing just part of a pbuf chain?


From: Brian McFarland
Subject: [lwip-users] Freeing just part of a pbuf chain?
Date: Mon, 21 Nov 2011 10:45:11 -0500

I’m using LwIP 1.3.1, but I’m  guessing this part hasn’t changed much.   

 

So say my tcp_recv() callback gives me three pbufs chained:  A->B->C.  If I need to save some of the data for later, what’s the intended mechanism for freeing A but not B->C?  Seems like could be accomplished either by pbuf_ref(B) and then pbuf_free(A) --OR-- pbuf_dechain(A) followed by pbuf_free(A).  Is that correct? Is either method *more* correct (i.e. always better), do both methods have their own advantages?

 

On a related note, if I don’t want to tcp_recv() any more data until processing the data in B->C, can I just postpone calling tcp_recved()?

 


reply via email to

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