lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Freeing memory after http transfer


From: Bernhard 'Gustl' Bauer
Subject: Re: [lwip-users] Freeing memory after http transfer
Date: Mon, 16 Nov 2009 07:53:23 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

address@hidden schrieb:
Bernhard 'Gustl' wrote:
tcp_write is used in my copy too.

Of course it is. The question is whether you pass TCP_WRITE_FLAG_COPY or zero as 4th argument to tcp_write(). If you pass TCP_WRITE_FLAG_COPY, data is copied from the pointer you pass to internal buffers which are freed when ACKed. If you pass zero, data is sent directly from the pointer you supplied ("zero copy").

In the first case (FLAG_COPY), you can free your buffer after passing it to tcp_write(), whereas in the latter (zero), you have to keep the buffer unchanged and allocated until the accumulated count from http_sent() tells you all data has been ACKed.


The 4th argument is zero. This is fine with me as I don't want to waste time copying data.

I'm not sure if the http_sent of version 1.3.0 is correct. It tries to close the connection before all data is ACKed.

I had a short look at the actual CVS and I think it may have the same problems. You may want to check this.

I will count the ACKed data which will solve my problem.

Thanks for your help

Gustl




reply via email to

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