cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl-library Digest, Vol 71, Issue 41

From: ajil koshy <ajil.koshy_at_gmail.com>
Date: Mon, 1 Aug 2011 14:38:42 +0530

> Message: 3
> Date: Thu, 28 Jul 2011 19:53:30 +0200 (CEST)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Curl_multi_perform goes into infinite loop
> Message-ID: <alpine.DEB.2.00.1107281944310.6733_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Thu, 28 Jul 2011, ajil koshy wrote:
>
> > I have an https client using libcurl (with openssl) multi APIs.
> > Occasionally, I see that if remote peer application exits, the libcurl
> > client's 'multi-loop' (the one which calls curl_multi_perform repeatedly
> > till running handles reach zero) goes into an infinite loop instead of
> > breaking out. Is this expected behavior?
>
> Without any kind of timeout set, I figure there's a risk that something
> stalls
> for what may be perceived as "infinitely".
>
> But also note that you didn't state what libcurl version or OS you're
> using.
>
I am using libcurl version 7.21.5.

>
> > Also, after each curl_multi_perform call, I also check if any errors
> > occurred on the individual transfers using curl_multi_info_read function
> in
> > which case I can exit the loop. I would like to know what is the
> definitive
> > way to find out if remote peer has disconnected (and thereby error out of
> > the multi-loop) while using libcurl?
>
> curl_multi_info_read() is the definitive way.
>

I am already calling curl_multi_info_read after calling curl_multi_perform.
This should probably return an error which I can use to break out, shouldn't
it? It doesn't do that always. The problem is intermittent. In some cases, I
see that calling curl_multi_info_read yields a connection closed error but
on some other occasions there is no error info and the loop just runs on and
on.

I have come across articles which suggest we can attempt to read from the
> > socket which would but I am not sure of implications of doing this while
> > using libcurl.
>
> That's a really bad iadea. If you would read from a socket that is still in
> use by libcurl then you will effectively ruin that transfer. Not to mention
> that you would have to make an effort to even get to know the socket in
> tthe
> first place.
>
Yes, I too felt it is a bad idea. I was planning to use CURLINFO_LASTSOCKET
for getting the socket being used.

>
> > Is there any callback I can register for or info I can query in libcurl
> to
> > achieve this?
>
> You don't need any callback for that, curl_multi_info_read() is all you
> need.
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 28 Jul 2011 20:39:20 +0200 (CEST)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Problem with file upload using CURLFORM_BUFFER
> Message-ID: <alpine.DEB.2.00.1107282035410.9781_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Wed, 27 Jul 2011, Henry Ludemann wrote:
>
> > The commit in f851f768578dc096c561d57ba07ffd1004d504c0
> > (CURLFORM_STREAM: acknowledge CURLFORM_FILENAME) broke uploading using
> > CURLFORM_BUFFER / CURLFORM_BUFFERPTR.
>
> Ouch. Thanks for the report. If you want bonus points, try writing up a
> test
> case for it. I'll look at the problem once I get back home next week.
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 28 Jul 2011 15:21:59 -0700 (PDT)
> From: Peter <one2001boy_at_yahoo.com>
> To: Pierre Joye <pierre.php_at_gmail.com>, "curl-library_at_cool.haxx.se"
> <curl-library_at_cool.haxx.se>
> Subject: Re: compilation in windows
> Message-ID:
> <1311891719.91237.YahooMailNeo_at_web125505.mail.ne1.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
>
> Pierre,
> >That's for the CRT linkage, it is usually better to use /MD over /MT,
> >unless one likes to provide updates when a new CRT version is
> >available.
>
>
> Thanks for your information.
> I am testing the examples now, CURLOPT_VERBOSE was set to 0.
> run the code and it will always display the following information:
> " % Total??? % Received % Xferd? Average Speed?? Time??? Time???? Time?
> Current
> ???????????????????????????????? Dload? Upload?? Total?? Spent??? Left?
> Speed
> 100?? 396? 100?? 380? 100??? 16??? 871???? 36 --:--:-- --:--:-- --:--:--??
> 902"
>
> is there a way to depress it?
>
> Thanks.
>
> Peter
>
>
>
> ------------------------------
>
> _______________________________________________
> curl-library mailing list
> curl-library_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
>
>
> End of curl-library Digest, Vol 71, Issue 41
> ********************************************
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-01