ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-HTTP/HTTP.pm
(Generate patch)

Comparing AnyEvent-HTTP/HTTP.pm (file contents):
Revision 1.128 by root, Sat Nov 26 03:45:33 2016 UTC vs.
Revision 1.129 by root, Thu Aug 30 00:08:16 2018 UTC

46use AnyEvent::Util (); 46use AnyEvent::Util ();
47use AnyEvent::Handle (); 47use AnyEvent::Handle ();
48 48
49use base Exporter::; 49use base Exporter::;
50 50
51our $VERSION = 2.24; 51our $VERSION = 2.25;
52 52
53our @EXPORT = qw(http_get http_post http_head http_request); 53our @EXPORT = qw(http_get http_post http_head http_request);
54 54
55our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)"; 55our $USERAGENT = "Mozilla/5.0 (compatible; U; AnyEvent-HTTP/$VERSION; +http://software.schmorp.de/pkg/AnyEvent)";
56our $MAX_RECURSE = 10; 56our $MAX_RECURSE = 10;
904 904
905 } elsif ($loc !~ /^(?: $ | [^:\/?\#]+ : )/x) { # anything "simple" 905 } elsif ($loc !~ /^(?: $ | [^:\/?\#]+ : )/x) { # anything "simple"
906 $loc =~ s/^\.\/+//; 906 $loc =~ s/^\.\/+//;
907 907
908 if ($loc !~ m%^[.?#]%) { 908 if ($loc !~ m%^[.?#]%) {
909 my $prefix = "$uscheme://$uhost:$uport"; 909 my $prefix = "$uscheme://$uauthority";
910 910
911 unless ($loc =~ s/^\///) { 911 unless ($loc =~ s/^\///) {
912 $prefix .= $upath; 912 $prefix .= $upath;
913 $prefix =~ s/\/[^\/]*$//; 913 $prefix =~ s/\/[^\/]*$//;
914 } 914 }
1217 # on a keepalive request (in theory, this should be a separate config option). 1217 # on a keepalive request (in theory, this should be a separate config option).
1218 if ($persistent && $KA_CACHE{$ka_key}) { 1218 if ($persistent && $KA_CACHE{$ka_key}) {
1219 $was_persistent = 1; 1219 $was_persistent = 1;
1220 1220
1221 $state{handle} = ka_fetch $ka_key; 1221 $state{handle} = ka_fetch $ka_key;
1222 $state{handle}->destroyed 1222# $state{handle}->destroyed
1223 and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d# 1223# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (1), please report.";#d#
1224 $prepare_handle->(); 1224 $prepare_handle->();
1225 $state{handle}->destroyed 1225# $state{handle}->destroyed
1226 and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d# 1226# and die "AnyEvent::HTTP: unexpectedly got a destructed handle (2), please report.";#d#
1227 $handle_actual_request->(); 1227 $handle_actual_request->();
1228 1228
1229 } else { 1229 } else {
1230 my $tcp_connect = $arg{tcp_connect} 1230 my $tcp_connect = $arg{tcp_connect}
1231 || do { require AnyEvent::Socket; \&AnyEvent::Socket::tcp_connect }; 1231 || do { require AnyEvent::Socket; \&AnyEvent::Socket::tcp_connect };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines