Skip Menu |
 

This queue is for tickets about the WWW-Curl CPAN distribution.

Report information
The Basics
Id: 35520
Status: resolved
Priority: 0/
Queue: WWW-Curl

People
Owner: Nobody in particular
Requestors: logan [...] dminteractive.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Nothing returned from info_read with WWW::Curl::Multi
Date: Tue, 29 Apr 2008 13:34:16 -0500
To: bug-WWW-Curl [...] rt.cpan.org
From: Mike Hokenson <logan [...] dminteractive.com>
Download (untitled) / with headers
text/plain 219b
Hi again, I tried following the example in Curl.pm for the Multi interface, but I don't seem to be getting anything back from $curlm->info_read. Attached is a small test program, is there a trick to it? Thanks, Mike
Download test_multi.pl
text/x-perl 1.4k

Message body is not shown because sender requested not to inline it.

On Tue Apr 29 14:35:15 2008, logan@dminteractive.com wrote: Show quoted text
> Hi again, > > I tried following the example in Curl.pm for the Multi interface, but > I don't seem to be getting anything back from $curlm->info_read. > Attached is a small test program, is there a trick to it? > > Thanks, > > Mike
Yeah, writing correct documentation ;) The example provided with WWW::Curl is wrong. The "while (my $active_transfers = $curlm->perform) {" part is entirely incorrect. ->perform is a non-blocking operation in this case and perform needs to be called periodically while there are active handles. The trouble was that $active_transfers reflects the state after the perform operation, which means that after all the http operations finished, it returns 0, but there wasn't a chance to collect the data yet. So it should read "while ($active_handles) { my $active_transfers = $curlm->perform; ... }", or alternatively create a tight perform loop and after the active count reached zero, just walk through the curl handles to grab the information. I'm going to release 4.01 soon, which should fix this.
This is fixed in v4.01.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.