Skip Menu |
 

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 36627
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

People
Owner: Nobody in particular
Requestors: pravus [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.84
Fixed in: 0.84

Attachments


Subject: Progress events do not work if the request results in a redirect response
Download (untitled) / with headers
text/plain 450b
Using the testcase provided, the following works: $ ./testcase 'http://www.yahoo.com/' However, the following fails to indicate progress due to a redirect: $ ./testcase 'http://yahoo.com' After tracing through the code, it appears as though the progress postback wasn't being propagated properly in the RequestFactory. The attached patch addresses this problem. The patch is against the most current release on CPAN (0.84) and passes all tests.
Subject: POE-Component-Client-HTTP-0.84-progress-on-redirect.patch
diff -urP POE-Component-Client-HTTP-0.84.orig/lib/POE/Component/Client/HTTP/RequestFactory.pm POE-Component-Client-HTTP-0.84/lib/POE/Component/Client/HTTP/RequestFactory.pm --- POE-Component-Client-HTTP-0.84.orig/lib/POE/Component/Client/HTTP/RequestFactory.pm 2008-04-19 19:18:02.000000000 -0500 +++ POE-Component-Client-HTTP-0.84/lib/POE/Component/Client/HTTP/RequestFactory.pm 2008-06-10 10:39:48.000000000 -0500 @@ -262,11 +262,19 @@ # Create a progress postback if requested. my $progress_postback; if (defined $progress_event) { - $progress_postback = $sender->postback( - $progress_event, - $http_request, - $tag - ); + if (ref $progress_event) { + # The given progress event appears to already + # be a postback, so use it. This is needed to + # propagate the postback through redirects. + $progress_postback = $progress_event; + } + else { + $progress_postback = $sender->postback( + $progress_event, + $http_request, + $tag + ); + } } # If we have a cookie jar, have it add the appropriate headers.
Subject: testcase
Download testcase
application/octet-stream 772b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 160b
I converted your test case into t/57_pravus_progress.t and added it along with your patch as revision 360. It will be included in the next release. Thank you!


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.