r23210 - in /branches/upstream/libpoe-component-client-http-perl/current: CHANGES META.yml lib/POE/Component/Client/HTTP.pm t/57_joel_immed_cancel.t t/58_joel_cancel_multi.t
ghostbar-guest at users.alioth.debian.org
ghostbar-guest at users.alioth.debian.org
Tue Jul 15 00:10:56 UTC 2008
Author: ghostbar-guest
Date: Tue Jul 15 00:10:52 2008
New Revision: 23210
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=23210
Log:
[svn-upgrade] Integrating new upstream version, libpoe-component-client-http-perl (0.85)
Modified:
branches/upstream/libpoe-component-client-http-perl/current/CHANGES
branches/upstream/libpoe-component-client-http-perl/current/META.yml
branches/upstream/libpoe-component-client-http-perl/current/lib/POE/Component/Client/HTTP.pm
branches/upstream/libpoe-component-client-http-perl/current/t/57_joel_immed_cancel.t
branches/upstream/libpoe-component-client-http-perl/current/t/58_joel_cancel_multi.t
Modified: branches/upstream/libpoe-component-client-http-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-client-http-perl/current/CHANGES?rev=23210&op=diff
==============================================================================
--- branches/upstream/libpoe-component-client-http-perl/current/CHANGES (original)
+++ branches/upstream/libpoe-component-client-http-perl/current/CHANGES Tue Jul 15 00:10:52 2008
@@ -1,6 +1,38 @@
-======================================
-9999-99-99 99:99:99.999999Z (untagged)
-======================================
+=================================
+2008-07-13T08:07:37.418057Z v0_85
+=================================
+
+ 2008-07-13 08:07:22 (r334) by rcaputo
+ lib/POE/Component/Client/HTTP.pm M
+
+ Time for another release.
+
+ 2008-07-13 06:26:14 (r333) by rcaputo
+ lib/POE/Component/Client/HTTP.pm M; t/57_joel_immed_cancel.t M;
+ t/58_joel_cancel_multi.t M
+
+ Don't die when canceling requests or shutting down components.
+
+ 2008-07-09 19:44:56 (r332) by martijn; t/04_chunk_filter.t M
+
+ forget about reading from DATA. This way we can control how much data
+ we feed to the filter, so we get better coverage.
+
+ 2008-07-09 19:44:41 (r331) by martijn; t/04_chunk_filter.t M
+
+ de-poe-ify 04_chunk_filter.t too.
+
+ 2008-07-09 19:44:21 (r330) by martijn; t/03_head_filter.t M
+
+ get coverage up to same level as with the old tests.
+
+ 2008-07-09 19:44:07 (r329) by martijn; t/03_head_filter.t M
+
+ stop using POE while testing Filter::HTTPHead.
+
+=================================
+2008-05-28T17:35:59.670622Z v0_84
+=================================
2008-05-28 17:33:06 (r327) by rcaputo
lib/POE/Component/Client/HTTP.pm M; t/14_gzipped_content.t M;
Modified: branches/upstream/libpoe-component-client-http-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-client-http-perl/current/META.yml?rev=23210&op=diff
==============================================================================
--- branches/upstream/libpoe-component-client-http-perl/current/META.yml (original)
+++ branches/upstream/libpoe-component-client-http-perl/current/META.yml Tue Jul 15 00:10:52 2008
@@ -1,9 +1,11 @@
--- #YAML:1.0
name: POE-Component-Client-HTTP
-version: 0.84
+version: 0.85
abstract: Non-blocking/concurrent HTTP queries with POE
license: perl
-generated_by: ExtUtils::MakeMaker version 6.31
+author:
+ - Rocco Caputo <rcaputo at cpan.org>
+generated_by: ExtUtils::MakeMaker version 6.44
distribution_type: module
requires:
HTTP::Request: 1.3
@@ -13,7 +15,5 @@
POE::Component::Client::Keepalive: 0.1001
URI: 1.24
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-author:
- - Rocco Caputo <rcaputo at cpan.org>
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: branches/upstream/libpoe-component-client-http-perl/current/lib/POE/Component/Client/HTTP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-client-http-perl/current/lib/POE/Component/Client/HTTP.pm?rev=23210&op=diff
==============================================================================
--- branches/upstream/libpoe-component-client-http-perl/current/lib/POE/Component/Client/HTTP.pm (original)
+++ branches/upstream/libpoe-component-client-http-perl/current/lib/POE/Component/Client/HTTP.pm Tue Jul 15 00:10:52 2008
@@ -1,4 +1,4 @@
-# $Id: HTTP.pm 327 2008-05-28 17:33:06Z rcaputo $
+# $Id: HTTP.pm 334 2008-07-13 08:07:22Z rcaputo $
package POE::Component::Client::HTTP;
@@ -11,7 +11,7 @@
use constant DEBUG_DATA => 0;
use vars qw($VERSION);
-$VERSION = '0.84';
+$VERSION = '0.85';
use Carp qw(croak);
use HTTP::Response;
@@ -274,20 +274,20 @@
my $cm_req_id;
eval {
- # get a connection from Client::Keepalive
- $request->[REQ_CONN_ID] = $heap->{cm}->allocate(
- scheme => $request->scheme,
- addr => $request->host,
- port => $request->port,
- context => $request->ID,
- event => 'got_connect_done',
- @timeout,
- );
+ # get a connection from Client::Keepalive
+ $request->[REQ_CONN_ID] = $heap->{cm}->allocate(
+ scheme => $request->scheme,
+ addr => $request->host,
+ port => $request->port,
+ context => $request->ID,
+ event => 'got_connect_done',
+ @timeout,
+ );
};
if ($@) {
- delete $heap->{request}->{$request->ID};
- # we can reach here for things like host being invalid.
- $request->error(400, $@);
+ delete $heap->{request}->{$request->ID};
+ # we can reach here for things like host being invalid.
+ $request->error(400, $@);
}
}
@@ -302,10 +302,24 @@
my $connection = $response->{'connection'};
my $request_id = $response->{'context'};
+ # Can't handle connections if we're shut down.
+ # TODO - How do we still get these? Were they previously queued or
+ # something?
+ if ($heap->{is_shut_down}) {
+ _internal_cancel(
+ $heap, $request_id, 408, "Request timed out (request canceled)"
+ );
+ return;
+ }
+
if (defined $connection) {
DEBUG and warn "CON: request $request_id connected ok...";
my $request = $heap->{request}->{$request_id};
+ unless (defined $request) {
+ DEBUG and warn "CON: ignoring connection for canceled request";
+ return;
+ }
my $block_size = $heap->{factory}->block_size;
@@ -466,8 +480,9 @@
my ($kernel, $heap, $operation, $errnum, $errstr, $wheel_id) =
@_[KERNEL, HEAP, ARG0..ARG3];
- DEBUG and
- warn "I/O: wheel $wheel_id encountered $operation error $errnum: $errstr";
+ DEBUG and warn(
+ "I/O: wheel $wheel_id encountered $operation error $errnum: $errstr"
+ );
# Drop the wheel.
my $request_id = delete $heap->{wheel_to_request}->{$wheel_id};
@@ -544,7 +559,7 @@
# not acceptable according to the accept headers sent in the
# request.
- $request->error (406, "Response larger than MaxSize - $request_id");
+ $request->error(406, "Response larger than MaxSize - $request_id");
}
}
@@ -895,12 +910,12 @@
my $request = delete $heap->{request}{$request_id};
return unless defined $request;
- DEBUG and warn "SHT: Shutdown is canceling request $request_id";
+ DEBUG and warn "CXL: canceling request $request_id";
$request->remove_timeout();
if (my $wheel = $request->wheel) {
my $wheel_id = $wheel->ID;
- DEBUG and warn "SHT: Request $request_id canceling wheel $wheel_id";
+ DEBUG and warn "CXL: Request $request_id canceling wheel $wheel_id";
delete $heap->{wheel_to_request}{$wheel_id};
delete $heap->{request_to_id}{$request->[REQ_REQUEST]};
$wheel = undef;
@@ -917,7 +932,7 @@
}
unless ($request->[REQ_STATE] & RS_POSTED) {
- $request->error(408, "Request timed out (component shut down)");
+ $request->error($code, $message);
}
}
@@ -936,7 +951,7 @@
# Shut down the connection manager subcomponent.
if (defined $heap->{cm}) {
- DEBUG and warn "SHT: Client::HTTP shutting down Client::Keepalive";
+ DEBUG and warn "CXL: Client::HTTP shutting down Client::Keepalive";
$heap->{cm}->shutdown();
delete $heap->{cm};
}
Modified: branches/upstream/libpoe-component-client-http-perl/current/t/57_joel_immed_cancel.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-client-http-perl/current/t/57_joel_immed_cancel.t?rev=23210&op=diff
==============================================================================
--- branches/upstream/libpoe-component-client-http-perl/current/t/57_joel_immed_cancel.t (original)
+++ branches/upstream/libpoe-component-client-http-perl/current/t/57_joel_immed_cancel.t Tue Jul 15 00:10:52 2008
@@ -1,5 +1,5 @@
#!perl
-# $Id: 57_joel_immed_cancel.t 272 2006-09-25 17:13:25Z rcaputo $
+# $Id: 57_joel_immed_cancel.t 333 2008-07-13 06:26:14Z rcaputo $
use strict;
use warnings;
@@ -31,4 +31,5 @@
sub response_handler {
my $response = $_[ARG1][0];
is( $response->code, 408, "timeout on a canceled request" );
+ $_[KERNEL]->post( ua => "shutdown" );
}
Modified: branches/upstream/libpoe-component-client-http-perl/current/t/58_joel_cancel_multi.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-component-client-http-perl/current/t/58_joel_cancel_multi.t?rev=23210&op=diff
==============================================================================
--- branches/upstream/libpoe-component-client-http-perl/current/t/58_joel_cancel_multi.t (original)
+++ branches/upstream/libpoe-component-client-http-perl/current/t/58_joel_cancel_multi.t Tue Jul 15 00:10:52 2008
@@ -58,25 +58,24 @@
sub client_start{
my $request = HTTP::Request->new('GET', "http://www.google.com/");
ok(
- $_[KERNEL]->post( ua => request => response => $request ),
- "post 1st req succeeds"
+ $_[KERNEL]->post( ua => request => response => $request ),
+ "post 1st req succeeds"
);
my $req2 = HTTP::Request->new('GET', "http://www.google.com/");
ok(
$_[KERNEL]->post( ua => request => response => $req2 ),
- "post 2nd req succeeds"
+ "post 2nd req succeeds"
);
my $req3 = HTTP::Request->new('GET', "http://poe.perl.org/");
ok (
$_[KERNEL]->post( ua => request => response => $req3 ),
- "post 3rd req succeeds"
+ "post 3rd req succeeds"
);
-
+
ok( $_[KERNEL]->post( ua => cancel => $request ), "cancel 1st req succeeds" );
-
}
More information about the Pkg-perl-cvs-commits
mailing list