[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-members] pbuf_dechain
From: |
Chris Borrelli |
Subject: |
Re: [lwip-members] pbuf_dechain |
Date: |
Thu, 12 Jun 2003 17:03:27 -0700 (PDT) |
Hi Leon,
The contrib/ports/unix/proj/minimal/echo.c
application uses the pbuf_dechain() function.
It is used in send_buf() shown below.
Is there a better way to do this now??
-Chris
send_buf(struct tcp_pcb *pcb, struct echo_state *es)
{
struct pbuf *q;
do {
q = es->p;
es->p = pbuf_dechain(q);
if (tcp_write(pcb, q->payload, q->len, 1) == ERR_MEM) {
pbuf_chain(q, es->p);
es->p = q;
return;
}
tcp_recved(pcb, q->len);
pbuf_free(q);
} while (es->p != NULL);
}
--- Leon Woestenberg wrote:
> Hello Jani,
>
> > I see that nothing ever calls pbuf_dechain after
> recent changes.
> >
> Right.
>
> pbuf_free(head) now decently deals with the
> situation where the
> head of a chain is removed and never used again.
> This seems to
> be the case in all core source code.
>
> > Is it expected to be called by apps in some
> scenarios?Or by core in
> > future?
> >
> Hmmm, yes, I can think of an approach where the
> queueing is expanded
> to chaining multiple pbuf chains and where we need
> dechain() again.
>
> For the moment, I would suggest surrounding the
> function with
> #if 0
> #endif
>
> I have done so in CVS current.
>
> Regards, Leon.
>
>
> _______________________________________________
> lwip-members mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-members
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).
- Re: [lwip-members] pbuf_dechain,
Chris Borrelli <=