[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Using pbufs in a recv function - next vs ref vs tot_le
From: |
Paul C |
Subject: |
Re: [lwip-users] Using pbufs in a recv function - next vs ref vs tot_len |
Date: |
Wed, 12 Jan 2005 21:54:23 +1030 |
Its normal that the q->len <= q->tot_len. If you add all the q->len's
in the chain (q = q->next) you get p->tot_len.
Paul
On Tue, 11 Jan 2005 21:26:57 -0800, "Chris Frost" <address@hidden>
said:
> On Wed, Jan 12, 2005 at 02:18:25PM +1030, Paul C wrote:
> > Here is a skeleton of the code I use.
>
> Thanks, this is very helpful. I was incorrectly using pbuf_free(), I had
> not read that it frees not just p, but all those in p's chain.
>
> Changing my code to follow your outline, transfers are sucessful, but
> I do notice that I get pbufs from time to time that for the first pbuf in
> the chain, q->len < p->tot_len. Ignoring this oddity appears to work,
> but it certainly seems odd. Might anyone comments on whether this may be
> expected or if it seems fishy?
>
> Fwiw in these cases, q->len = 48, p->tot_len = 96, q is the first
> in the chain (q == p), and q->next is not 0.
>
> --
> Chris Frost | <http://www.frostnet.net/chris/>
> -------------+----------------------------------
> Public PGP Key:
> Email address@hidden with the subject "retrieve pgp key"
> or visit <http://www.frostnet.net/chris/about/pgp_key.phtml>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users