curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multiple READFUNCTION callbacks not happening

From: Pushkar Kulkarni <pushkar.rvce_at_gmail.com>
Date: Mon, 23 Jan 2017 15:10:56 +0530

Hi Daniel/Dan,

Thanks for your inputs. I decided to try with a debug libcurl.

My colleague built a debug libcurl with this source:
*https://curl.haxx.se/download/curl-7.52.1.tar.gz
<https://curl.haxx.se/download/curl-7.52.1.tar.gz>*

When I link and run my test case with this debug library, I see a hang and
a subsequent timeout, in the SSL handshake that happens before the data
transfer. I don't see this hang with the regular libcurl (I use 7.47)

Is this something known? Here's the output:

[1] STATE: INIT => CONNECT handle 0x6a8d538; line 1413
(connection #-5000)␊

[1] Added connection 0. The cache now contains 1 members␊

[1] Trying 54.209.159.70...␊

[1] TCP_NODELAY set␊

[1] STATE: CONNECT => WAITCONNECT handle 0x6a8d538; line
1466 (connection #0)␊

[1] Connected to gateway-a.watsonplatform.net
(54.209.159.70) port 443 (#0)␊

[1] STATE: WAITCONNECT => SENDPROTOCONNECT handle
0x6a8d538; line 1583 (connection #0)␊

[1] Marked for [keep alive]: HTTP default␊

[1] ALPN, offering http/1.1␊

[1] Cipher selection:
ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH␊

[1] successfully set certificate verify locations:␊

[1] CAfile: /etc/ssl/certs/ca-certificates.crt␊
CApath: none␊

[1] TLSv1.2 (OUT), TLS header, Certificate Status (22):␊

[1] => Send SSL data ␖␃␁␂␀

[1] TLSv1.2 (OUT), TLS handshake, Client hello (1):␊

[1] => Send SSL data

[1] STATE: SENDPROTOCONNECT => PROTOCONNECT handle
0x6a8d538; line 1597 (connection #0)␊

-------hang and timeout ---------

On Fri, Jan 20, 2017 at 2:16 PM, Pushkar Kulkarni <pushkar.rvce_at_gmail.com>
wrote:

> Hi Daniel,
>
> Thanks for the prompt response.
>
> >> Hm. Which version of libcurl is this? Can you try to set
> CURLOPT_POSTFIELDSIZE instead of CURLOPT_INFILESIZE >> for the POST size?
> That's what post-callback.c does... (I would expect them to work the same
> in 7.43.0 or later but who >> knows for sure!)
> Yes, I did try setting CURLOPT_POSTFIELDSIZE. I see the same behaviour :-(
> I am using libcurl 7.47.0 on Ubuntu 16.04.
>
> >> It'll be much more helpful if you posted a stand-alone example that
> reproduces the problem. Possibily by changing the >> post-callback.c
> example to work more like your code.
> I'll try to work on this.
>
> Thanks again,
> Pushkar
>
> On Fri, Jan 20, 2017 at 12:37 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
>> On Fri, 20 Jan 2017, Pushkar Kulkarni wrote:
>>
>> If for a payload of 23K, we set the CURLOPT_INFILESIZE to 23K, we get
>>> only one callback with size*nmemb = 16K. There are no subsequent callbacks
>>> and hence the server keeps waiting before timing out.
>>>
>>
>> Hm. Which version of libcurl is this? Can you try to set
>> CURLOPT_POSTFIELDSIZE instead of CURLOPT_INFILESIZE for the POST size?
>> That's what post-callback.c does... (I would expect them to work the same
>> in 7.43.0 or later but who knows for sure!)
>>
>> Do let me know if you need more clarity on the code.
>>>
>>
>> It'll be much more helpful if you posted a stand-alone example that
>> reproduces the problem. Possibily by changing the post-callback.c example
>> to work more like your code.
>>
>> Is there a way to dump all the options set on an easy handle? Though the
>>> programmer must know what option he/she's setting, I am wondering if
>>> there's a way to have it as a debug output.
>>>
>>
>> No there isn't. But I'll agree that such a function would be really handy
>> at times...
>>
>> --
>>
>> / daniel.haxx.se
>> -------------------------------------------------------------------
>> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
>> Etiquette: https://curl.haxx.se/mail/etiquette.html
>
>
>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-01-23