cURL / Mailing Lists / curl-library / Single Mail


Re: curl_schannel.c and realloc()

From: Daniel Stenberg <>
Date: Wed, 13 Jun 2012 13:01:52 +0200 (CEST)

On Wed, 13 Jun 2012, Marc Hoersken wrote:

>> Then, as a follow-up improvement the code could probably use the 'buf'
>> buffer immediately instead of separately storing received data in a
>> malloc'ed buffer that is then memcpy()'ed to 'buf'.
> The problem is that we still need to buffer the received encrypted and
> unencrypted data since such data can already arive during the initial
> SSL/TLS handshake handled by the step-functions. Therefore we need the
> buffer to have the data available for the next read. And we also need this
> buffer between reads, because there might be an incomplete encrpyted SSL/TLS
> packet in the queue. Also there might be more data decrypted by
> DecryptMessage than the user wants to read, so we need to store that already
> decrypted data, too.

Oh right. Sorry for suggsting such things without actually checking out the
code carefully enough to say if it is indeed possible to do.

Thanks for the details!

List admin:
Received on 2012-06-13