[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] pbuf_cat() does not update total_len
From: |
Bill Auerbach |
Subject: |
Re: [lwip-devel] pbuf_cat() does not update total_len |
Date: |
Tue, 3 Feb 2015 13:12:47 -0500 |
Hello,
My understanding is that the head is pbuf to reference for total length and
is how I've used it for years. I pbuf_cat on each recv callback to create a
"stream" of pbufs. I have a routine to pull data off the front keeping the
chain intact. The head is used for the total length in the chain.
Bill
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Laurenz Kamp
Sent: Tuesday, February 03, 2015 11:37 AM
To: address@hidden
Subject: [lwip-devel] pbuf_cat() does not update total_len
Hello,
let's assume I want to merge two pbufs into one and I use pbuf_cat() for the
task.
a and b are the pbufs I want to merge:
First pbuf: a.len = 10;
a.total_len = 10;
a.next = NULL;
Second pbuf: b.len = 15;
b.total_len = 15;
b.next = NULL;
After I call pbuf_cat(a, b), I have the following setup:
First pbuf: a.len = 10;
a.total_len = 25;
a.next = b;
Second pbuf: b.len = 15;
b.total_len = 15; <-- Should be 25.
b.next = NULL;
As far as I understand, all pbufs in a chain have the same total_len value,
but pbuf_cat doesn't update b.total_len. Is this behavior intentioned or a
bug?
Best regards,
Laurenz Kamp
_______________________________________________
lwip-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-devel