cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting Multi Info in Perl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 22 Sep 2006 23:02:10 +0200 (CEST)

On Fri, 22 Sep 2006, Karel K. wrote:

> I am trying to set up a perl program that reuses handles being passed to
> curl multi. The perl-module's documentation however does not have any
> reference to curl_multi_info_read and similar functions.

I don't know anything about the perl interface, and unfortunately I don't
think you'll find very many in here that do. (I hope I'm wrong.)

> 1. Is there any way to receive a list of all handles that were passed to
> Curl Multi, the number of running processes etc. Or do I have to store the
> information on Curl-Easy handles created in separate variables and query
> them directly?

There's no such list provided by libcurl itself at least. And the "number of
running processes" is not increased by libcurl since 'multi' does not imply
threads, just multiple transfers. It does all transfers in the same thread.

But each call to curl_multi_perform() does inform the caller about how many
transfers that are still "alive" (ie not done yet).

> 2. Alternatively: Referring to the multi.pl example provided with curl, how
> would I detect a timed-out transfer? There does not seem to be a kind of
> error callback or something like that.

curl actually does not provide any 'multi.pl' example, you must be referring
to the WWW-Curl package (from CPAN). But no, I don't know how that is
used/done. In libcurl you read out the post-transfer information such as that
with curl_multi_info_read(), but you seem to have figured that out already.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-09-22