mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
Fixed missing variable.
This commit is contained in:
parent
00809b49f1
commit
e6cc785fff
@ -415,7 +415,7 @@ pbuf_refresh(void)
|
|||||||
void
|
void
|
||||||
pbuf_realloc(struct pbuf *p, u16_t new_len)
|
pbuf_realloc(struct pbuf *p, u16_t new_len)
|
||||||
{
|
{
|
||||||
struct pbuf *q, *r;
|
struct pbuf *q;
|
||||||
u16_t rem_len; /* remaining length */
|
u16_t rem_len; /* remaining length */
|
||||||
s16_t grow;
|
s16_t grow;
|
||||||
|
|
||||||
@ -701,6 +701,7 @@ struct pbuf *
|
|||||||
pbuf_dechain(struct pbuf *p)
|
pbuf_dechain(struct pbuf *p)
|
||||||
{
|
{
|
||||||
struct pbuf *q;
|
struct pbuf *q;
|
||||||
|
u8_t deallocated;
|
||||||
/* tail */
|
/* tail */
|
||||||
q = p->next;
|
q = p->next;
|
||||||
/* pbuf has successor in chain? */
|
/* pbuf has successor in chain? */
|
||||||
@ -713,13 +714,11 @@ pbuf_dechain(struct pbuf *p)
|
|||||||
/* decouple pbuf from remainder */
|
/* decouple pbuf from remainder */
|
||||||
p->tot_len = p->len;
|
p->tot_len = p->len;
|
||||||
p->next = NULL;
|
p->next = NULL;
|
||||||
#if PBUF_CHAIN_DOES_REFER /** TODO (WORK IN PROGRESS) */
|
/* q is no longer referenced by p, free */
|
||||||
/* q is no longer referenced by p */
|
|
||||||
deallocated = pbuf_free(q);
|
deallocated = pbuf_free(q);
|
||||||
DEBUGF(PBUF_DEBUG | DBG_FRESH | 2, ("pbuf_dechain: unreferencing %p\n", (void *) q));
|
DEBUGF(PBUF_DEBUG | DBG_FRESH | 2, ("pbuf_dechain: unreferencing %p\n", (void *) q));
|
||||||
#endif
|
|
||||||
/* return remaining tail or NULL if deallocated */
|
/* return remaining tail or NULL if deallocated */
|
||||||
return (deallocated? NULL: q);
|
return (deallocated > 0? NULL: q);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -785,19 +784,19 @@ pbuf_take(struct pbuf *f)
|
|||||||
/* remove linkage from original pbuf */
|
/* remove linkage from original pbuf */
|
||||||
p->next = NULL;
|
p->next = NULL;
|
||||||
/* remove linkage to original pbuf */
|
/* remove linkage to original pbuf */
|
||||||
if (prev != NULL)
|
if (prev != NULL) {
|
||||||
/* prev->next == p at this point */
|
/* prev->next == p at this point */
|
||||||
/* break chain and insert new pbuf instead */
|
/* break chain and insert new pbuf instead */
|
||||||
prev->next = q;
|
prev->next = q;
|
||||||
/* p is no longer pointed to by prev or by our caller,
|
/* p is no longer pointed to by prev or by our caller,
|
||||||
* as the caller must do p = pbuf_take(p); so free it
|
* as the caller must do p = pbuf_take(p); so free it
|
||||||
* from our usage.
|
* from reference through linkage.
|
||||||
* note that we have set p->next to NULL already so that
|
* note that we have set p->next to NULL already so that
|
||||||
* we will not free the rest of the chain by accident.
|
* we will not free the rest of the chain by accident.
|
||||||
*/
|
*/
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
/* prev == NULL, so we replaced the top pbuf of the chain */
|
/* prev == NULL, so we replaced the top pbuf of the chain */
|
||||||
else
|
} else
|
||||||
top = q;
|
top = q;
|
||||||
/* copy pbuf payload */
|
/* copy pbuf payload */
|
||||||
memcpy(q->payload, p->payload, p->len);
|
memcpy(q->payload, p->payload, p->len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user