mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
Replaced pbuf.c 1.34 pbuf_take() change by simpler alternative.
This commit is contained in:
parent
09ca7a181b
commit
4c3512c0a2
@ -710,12 +710,10 @@ pbuf_chain(struct pbuf *h, struct pbuf *t)
|
||||
LWIP_ASSERT("t != NULL", t != NULL);
|
||||
|
||||
/* proceed to last pbuf of chain */
|
||||
for (p = h; p->next != NULL; p = p->next) {
|
||||
for (p = h; p != NULL; p = p->next) {
|
||||
/* add total length of second chain to all totals of first chain */
|
||||
p->tot_len += t->tot_len;
|
||||
}
|
||||
/* add total length of second chain to last buffer tot_len in first chain */
|
||||
p->tot_len += t->tot_len;
|
||||
|
||||
/* chain last pbuf of h chain (p) with first of tail (t) */
|
||||
p->next = t;
|
||||
@ -843,9 +841,7 @@ pbuf_take(struct pbuf *f)
|
||||
*/
|
||||
pbuf_free(p);
|
||||
p = q;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* deallocate chain */
|
||||
pbuf_free(top);
|
||||
DEBUGF(PBUF_DEBUG | 2, ("pbuf_take: failed to allocate replacement pbuf for %p\n", (void *)p));
|
||||
|
Loading…
Reference in New Issue
Block a user