710 |
LWIP_ASSERT("t != NULL", t != NULL); |
LWIP_ASSERT("t != NULL", t != NULL); |
711 |
|
|
712 |
/* proceed to last pbuf of chain */ |
/* proceed to last pbuf of chain */ |
713 |
for (p = h; p->next != NULL; p = p->next) { |
for (p = h; p != NULL; p = p->next) { |
714 |
/* add total length of second chain to all totals of first chain */ |
/* add total length of second chain to all totals of first chain */ |
715 |
p->tot_len += t->tot_len; |
p->tot_len += t->tot_len; |
716 |
} |
} |
717 |
/* add total length of second chain to last buffer tot_len in first chain */ |
|
|
p->tot_len += t->tot_len; |
|
|
|
|
718 |
/* chain last pbuf of h chain (p) with first of tail (t) */ |
/* chain last pbuf of h chain (p) with first of tail (t) */ |
719 |
p->next = t; |
p->next = t; |
720 |
/* t is now referenced to one more time */ |
/* t is now referenced to one more time */ |
841 |
*/ |
*/ |
842 |
pbuf_free(p); |
pbuf_free(p); |
843 |
p = q; |
p = q; |
844 |
} |
} else { |
|
else |
|
|
{ |
|
845 |
/* deallocate chain */ |
/* deallocate chain */ |
846 |
pbuf_free(top); |
pbuf_free(top); |
847 |
DEBUGF(PBUF_DEBUG | 2, ("pbuf_take: failed to allocate replacement pbuf for %p\n", (void *)p)); |
DEBUGF(PBUF_DEBUG | 2, ("pbuf_take: failed to allocate replacement pbuf for %p\n", (void *)p)); |