lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] http server and pbuf overflow


From: Bernhard 'Gustl' Bauer
Subject: Re: [lwip-users] http server and pbuf overflow
Date: Tue, 19 Jan 2010 07:54:34 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

address@hidden schrieb:
Bernhard 'Gustl' Bauer wrote:
First of all, only to make sure what you mean, are you referring to the PBUF_POOL running out of pbufs?

Yes

I'm not sure I understand the pbuf concept.
You have to call pbuf_free() on every pbuf chain passed to your application (via the receive callback). If can chain two chains together using pbuf_cat(), you only have to call pbuf_free() on the head of the chain.

This chained pbufs are new to me. I treated every call from tcp_recv as if it contained only 1 pbuf = packet.

  I have some data transfers
that exceed 1 tcp packet.

Every time http_recv is called I check if this is the 1st packet. If it
is I set a pointer to this pbuf and do not free this pbuf. If it is not
the 1st packet I store the data and free this pbuf.
What do you mean by 'store the data and free this pbuf'?

I copy the payload to a different location and call pbuf_free whit the pointer to pbuf.

Gustl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]