lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] pbuf question


From: Tim Newsham
Subject: Re: [lwip-users] pbuf question
Date: Fri, 9 Jul 2004 17:24:30 -1000 (HST)

> The pbuf_chain function that you are calling is appropriate if you are
> trying to assemble a single packet from multiple pbufs.  It is not
> appropriate if you are trying to create a multi-packet queue.  The
> pbuf_queue function does that.  Same goes for pbuf_dechain and pbuf_dequeue.

Somewhat inbetween in my situation.  The pbuf is a chain of data
passed up from tcp (no longer packetized).  I found out I was getting
two chains with refs (1,1) and (1,1).  When I queued them together
it bumped the ref on the second resulting in (1,1,2,1).  What
I ended up doing (hack) for the moment is bumping the ref on
all of the items in the chain after the head (ie 1,2 and 1,2)
before queueing them.  After that I can dequeue them one at a time.

The purpose of this buffer was to queue up received data before
delivering it to the client.  I think the code is still flawed
slightly in that if the client wants too much data, lwip will
run out of space before the request can be completed and I
will probably end up locking up the system.

Tim N.





reply via email to

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