curl-library
Re: curl_schannel.c and realloc()
Date: Wed, 20 Jun 2012 22:54:08 +0200
Hi Daniel,
2012/6/20 Daniel Stenberg <daniel_at_haxx.se>
>
> On Wed, 20 Jun 2012, Marc Hoersken wrote:
>
>>> Maybe we can start off with * 16 and see if we ever hit that with sensible
>>> servers.
>>
>>
>> Attached you will find a patch that implements those changes on top of
>> the current master 066811592dbcd49bc36294b244ad64ea08b6fa15.
>
>
> I don't understand. The doubling and >= *16 check is already in git, isn't it?
No, it's not in there for all reallocations. Mark used the new
strategy for one reallocation in his latest commits to the handshake
operation, but there are still two other reallocations during the
receive operation that have not been changed.
> This patch seems to change when the reallocation is made, but the commit message doesn't explain that nor the reasoning behind it.
Not really, it just updates the two remaining reallocations that have
already been there and fixes the other one to use the same "do we need
to increase the buffer"-condition as the other two.
CURL_SCHANNEL_BUFFER_STEP_SIZE was renamed to
CURL_SCHANNEL_BUFFER_FREE_SIZE since that is actually what it is now.
Since we don't know how much more data we are going to read during the
handshake, CURL_SCHANNEL_BUFFER_FREE_SIZE is used as the minimum free
space required in the buffer for the next operation.
CURL_SCHANNEL_BUFFER_STEP_SIZE was used for that before, too, but
since we don't have a step size now, the define was renamed.
Best regards,
Marc
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-20