cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Does curl_easy_pause abort SSL handshake?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 29 Apr 2016 14:38:50 +0200 (CEST)

On Tue, 26 Apr 2016, SellBuy Sammamish wrote:

> I use cURL to send HTTP/SSL packets using POST. Multipart is used to send
> binary data. I have a read callback which obtains the data. The callback
> pauses the connection by returning CURL_READFUNC_PAUSE when data is
> temporarily unavailable. A progress callback then unpauses the connection by
> calling curl_easy_pause(pCurl, CURLPAUSE_SEND_CONT) when data become
> available.
>
> Recently I noticed a significant delay during SSL handshake when multipart
> is used. Although unconfirmed, I have a hunch that since my read callback is
> probably called before the data is available, it pauses the connection,
> thereby preventing SSL handshake from starting.
>
> Is my suspicion (un-)founded? Can SSL negotiation be disrupted by pausing
> the connection?

No, that shouldn't happen. The handshake will complete before libcurl will
consider uploading any data so it won't ask for any with a callback until
after the TLS connection has been established.

If you switch on the DEBUGFUNCTION (like in this example
https://curl.haxx.se/libcurl/c/debug.html) and perhaps add some high
resolution time info in there, you might get some clues where/when the time is
spent. I know I would appreciate that info trying to figure out where the
slowness lies.

What libcurl version on which platform do you use when you see this?

> I noticed a significant delay during SSL handshake when multipart is used.

So it actually connects faster when not doing multipart posts? That amazes me.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-04-29