--- AnyEvent-HTTP/HTTP.pm 2011/06/14 05:20:13 1.106 +++ AnyEvent-HTTP/HTTP.pm 2012/02/10 01:26:59 1.110 @@ -48,7 +48,7 @@ use base Exporter::; -our $VERSION = '2.11'; +our $VERSION = '2.13'; our @EXPORT = qw(http_get http_post http_head http_request); @@ -386,7 +386,7 @@ timeout of 30 seconds. http_request - GET => "https://www.google.com", + HEAD => "https://www.google.com", headers => { "user-agent" => "MySearchClient 1.0" }, timeout => 30, sub { @@ -964,7 +964,7 @@ $state{read_chunk} = sub { $_[1] =~ /^([0-9a-fA-F]+)/ - or $finish->(undef, $ae_error => "Garbled chunked transfer encoding"); + or return $finish->(undef, $ae_error => "Garbled chunked transfer encoding"); my $len = hex $1; @@ -1140,13 +1140,11 @@ $state{handle} = ka_fetch $ka_key; $state{handle}->destroyed - and die "got a destructed handle. pah\n";#d# + and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d# $prepare_handle->(); $state{handle}->destroyed - and die "got a destructed handle. pa2\n";#d# + and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d# $handle_actual_request->(); - $state{handle}->destroyed - and die "got a destructed handle. pa3\n";#d# } else { my $tcp_connect = $arg{tcp_connect} @@ -1257,7 +1255,7 @@ =item $AnyEvent::HTTP::TIMEOUT -The default timeout for conenction operations (default: C<300>). +The default timeout for connection operations (default: C<300>). =item $AnyEvent::HTTP::USERAGENT @@ -1388,7 +1386,7 @@ warn -s _; if (stat $fh and -s _) { $ofs = -s _; - warn "-s is ", $ofs;#d# + warn "-s is ", $ofs; $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9]; $hdr{"range"} = "bytes=$ofs-"; }