line |
true |
false |
branch |
41
|
0 |
32 |
@_ == 1 ? : |
47
|
0 |
32 |
if (defined $args{'headers'}) |
51
|
0 |
0 |
if (lc $name eq 'connection') { } |
126
|
3 |
2 |
if (@_ == 2) { } |
136
|
3 |
0 |
if (lc $headers->[$i] eq $key) |
147
|
20 |
9 |
if lc $headers->[$i] eq $key |
154
|
10 |
2 |
if exists $INC{$file} |
155
|
0 |
2 |
unless (eval {
do {
require $file
}
}) |
156
|
0 |
0 |
if ($@ =~ /^Can't locate/) { } |
176
|
1 |
34 |
unless $url =~ m[\A
([a-z]+) # scheme
://
(?:
([^/:\@?]+) # user
:
([^/:\@?]+) # password
@
)?
([^/:?]+) # host
(?: : (\d+) )? # port
(?: ( /? \? .* | / .*) )? # path_query
\z]msx |
196
|
0 |
0 |
ref $content eq 'ARRAY' ? : |
|
0 |
0 |
ref $content eq 'HASH' ? : |
213
|
4 |
4 |
if $ENV{'REQUEST_METHOD'} |
226
|
23 |
44 |
if (defined(my $url = $args{'url'})) { } |
231
|
0 |
44 |
unless (defined $host) |
236
|
44 |
23 |
if (not defined $scheme) { } |
|
6 |
34 |
elsif ($scheme ne 'http' and $scheme ne 'https') { } |
242
|
61 |
0 |
$scheme eq 'http' ? : |
245
|
1 |
60 |
unless (defined $port) |
248
|
13 |
48 |
unless (defined $path_query) |
252
|
3 |
58 |
unless (substr($path_query, 0, 1) eq '/') |
257
|
0 |
61 |
if ($host =~ /[^A-Za-z0-9._-]/) |
265
|
0 |
61 |
if ($proxy and $no_proxy) |
266
|
0 |
0 |
if ($self->match_no_proxy($no_proxy, $host)) |
274
|
26 |
35 |
if (defined $sock) |
275
|
2 |
24 |
if ($self->_do_select(0, $sock, 0)) { } |
282
|
37 |
24 |
unless ($in_keepalive) |
284
|
0 |
37 |
if ($proxy) { } |
288
|
0 |
0 |
if (defined $proxy_user) |
297
|
0 |
0 |
if ($scheme eq 'http') { } |
300
|
0 |
0 |
if (defined $proxy_authorization) |
308
|
37 |
0 |
if ($scheme eq 'http') { } |
316
|
1 |
36 |
unless $sock |
329
|
1 |
59 |
if $method eq 'HEAD' |
331
|
14 |
46 |
if (my $in_headers = $args{'headers'}) |
334
|
0 |
18 |
if (lc $name eq 'connection') { } |
342
|
0 |
60 |
if (exists $self->{'proxy_authorization'}) |
345
|
6 |
54 |
if (defined $username) |
354
|
0 |
60 |
if (defined $cookie_jar) |
356
|
0 |
0 |
if ($args{'url'}) { } |
365
|
0 |
0 |
exists $args{'port'} ? : |
|
0 |
0 |
exists $args{'path_query'} ? : |
373
|
3 |
57 |
if (defined $content) |
375
|
0 |
3 |
if (not $content_is_fh and ref $content) |
377
|
0 |
0 |
unless (defined _header_get(\@headers, 'Content-Type')) |
382
|
3 |
0 |
unless (defined _header_get(\@headers, 'Content-Length')) |
384
|
0 |
3 |
if ($content_is_fh) { } |
386
|
0 |
0 |
unless $_[0] |
405
|
1 |
59 |
$port == $default_port ? : |
408
|
0 |
60 |
$proxy && $scheme eq 'http' ? : |
418
|
0 |
60 |
unless $self->write_all($sock, $p, $timeout_at) |
422
|
1 |
59 |
if ($self->{'capture_request'}) |
426
|
3 |
57 |
if (defined $content) |
427
|
0 |
3 |
if ($content_is_fh) { } |
432
|
0 |
0 |
if (not defined $ret) { } |
|
0 |
0 |
elsif ($ret == 0) { } |
437
|
0 |
0 |
unless $self->write_all($sock, $buf, $timeout_at) |
442
|
0 |
0 |
if ($self->{'capture_request'}) |
447
|
0 |
3 |
if (length $content > 0) |
448
|
0 |
0 |
unless $self->write_all($sock, $content, $timeout_at) |
453
|
0 |
0 |
if ($self->{'capture_request'}) |
477
|
3 |
209 |
if (not $n) { } |
478
|
0 |
3 |
if ($in_keepalive and length $buf == 0 and defined $n || $! == 104 || 0) |
483
|
3 |
0 |
!defined($n) ? : |
494
|
0 |
209 |
if ($ret == -1) { } |
|
147 |
62 |
elsif ($ret == -2) { } |
504
|
5 |
57 |
if (int $res_status / 100 eq 1) |
518
|
0 |
57 |
if ($special_headers->{'location'}) |
519
|
0 |
0 |
defined $args{'max_redirects'} ? : |
524
|
57 |
0 |
unless ($do_redirect) |
525
|
0 |
57 |
if (my $fh = $args{'write_file'}) { } |
|
0 |
57 |
elsif (my $coderef = $args{'write_code'}) { } |
534
|
0 |
57 |
if (exists $COMPRESSED{$special_headers->{'content-encoding'}}) |
542
|
1 |
56 |
if (defined $content_length and not $content_length =~ /\A[0-9]+\z/) |
546
|
49 |
6 |
unless ($method eq 'HEAD' or $res_status < 200 and $res_status >= 100 or $res_status == 204 or $res_status == 304) |
551
|
7 |
42 |
if ($chunked) { } |
556
|
1 |
41 |
if (ref $res_content or not defined $content_length) { } |
566
|
1 |
48 |
if (@err) |
572
|
54 |
1 |
if (lc $connection_header eq 'keep-alive') |
574
|
10 |
44 |
$res_minor_version == 0 ? : |
|
44 |
0 |
if ($res_minor_version == 0 ? $connection eq 'keep-alive' : $connection ne 'close' and defined $content_length || $chunked) |
586
|
0 |
55 |
if (defined $cookie_jar) |
587
|
0 |
0 |
defined $username && defined $password ? : |
595
|
0 |
0 |
unless ref $cookies |
601
|
0 |
55 |
if ($do_redirect) |
603
|
0 |
0 |
unless ($location =~ m[^[a-z0-9]+://]) |
616
|
0 |
0 |
$res_status eq '301' || $res_status eq '307' ? : |
626
|
0 |
55 |
if (ref $res_content) |
642
|
0 |
37 |
if $timeout <= 0 |
645
|
1 |
36 |
unless $sock_addr |
648
|
0 |
36 |
unless socket $sock, Socket::sockaddr_family($sock_addr), 1, 0 |
652
|
0 |
36 |
if (CORE::connect $sock, $sock_addr) { } |
|
36 |
0 |
elsif ($! == 115 or 0) { } |
655
|
0 |
36 |
unless $self->do_select(1, $sock, $timeout_at) |
659
|
0 |
0 |
if ($! == 4 and not $self->{'stop_if'}->()) |
670
|
1 |
36 |
if ($self->{'get_address'}) |
674
|
1 |
35 |
unless my $iaddr = $self->{'inet_aton'}->($host, $timeout) |
682
|
0 |
0 |
unless (exists $ssl_opts->{'SSL_verify_mode'}) |
685
|
0 |
0 |
unless (exists $ssl_opts->{'SSL_verifycn_scheme'}) |
689
|
0 |
0 |
if ($ssl_opts->{'SSL_verify_mode'}) |
690
|
0 |
0 |
unless (exists $ssl_opts->{'SSL_ca_file'} or exists $ssl_opts->{'SSL_ca_path'}) |
706
|
0 |
0 |
unless $sock |
710
|
0 |
0 |
if $timeout <= 0 |
714
|
0 |
0 |
unless 'IO::Socket::SSL'->start_SSL($sock, 'PeerHost', $host, 'PeerPort', $port, 'Timeout', $timeout, %$ssl_opts) |
732
|
0 |
0 |
if (defined $proxy_authorization) |
736
|
0 |
0 |
unless $self->write_all($sock, $p, $timeout_at) |
742
|
0 |
0 |
if (not defined $read) { } |
|
0 |
0 |
elsif ($read == 0) { } |
|
0 |
0 |
elsif (not $buf =~ m[^HTTP/1\.[0-9] 200 .+\015\012]) { } |
751
|
0 |
0 |
if $timeout_at <= 0 |
755
|
0 |
0 |
unless (exists $ssl_opts->{'SSL_verifycn_name'}) |
759
|
0 |
0 |
unless 'IO::Socket::SSL'->start_SSL($sock, 'PeerHost', $host, 'PeerPort', $port, 'Timeout', $timeout, %$ssl_opts) |
774
|
2082 |
524 |
if (my($header, $next_len) = $buf =~ /\A ( # header
( [0-9a-fA-F]+ ) # next_len (hex number)
(?:;
$HTTP_TOKEN
=
(?: $HTTP_TOKEN | $HTTP_QUOTED_STRING )
)* # optional chunk-extensions
[ ]* # www.yahoo.com adds spaces here.
# Is this valid?
\015\012 # CR+LF
) /mosx) |
793
|
6 |
2076 |
if ($next_len == 0) |
801
|
0 |
1026 |
unless ($n) |
802
|
0 |
0 |
!defined($n) ? : |
811
|
1820 |
256 |
if (length $buf > 0) |
818
|
1 |
779 |
unless ($n) |
819
|
0 |
1 |
!defined($n) ? : |
837
|
1 |
0 |
unless ($n) |
838
|
1 |
0 |
unless defined $res_content_length |
839
|
0 |
0 |
!defined($n) ? : |
859
|
0 |
29 |
unless ($n) |
860
|
0 |
0 |
!defined($n) ? : |
876
|
0 |
94 |
if $timeout_at > $inactivity_timeout_at |
881
|
0 |
97 |
if ($timeout <= 0) |
886
|
91 |
6 |
if $nfound > 0 |
887
|
3 |
3 |
if $nfound == -1 and $! == 4 and $self->{'stop_if'}->() |
898
|
36 |
87 |
if ($is_write) { } |
916
|
2045 |
58 |
if defined($ret = sysread($sock, $$buf, $len, $off)) |
918
|
58 |
0 |
if ($! == 11 or $! == 11 or 0) { } |
|
0 |
0 |
elsif ($! == 4) { } |
921
|
0 |
0 |
if $self->{'stop_if'}->() |
927
|
3 |
55 |
unless $self->do_select(0, $sock, $timeout_at) |
937
|
60 |
0 |
if defined($ret = syswrite($sock, $buf, $len, $off)) |
939
|
0 |
0 |
if ($! == 11 or $! == 11 or 0) { } |
|
0 |
0 |
elsif ($! == 4) { } |
942
|
0 |
0 |
if $self->{'stop_if'}->() |
947
|
0 |
0 |
unless $self->do_select(1, $sock, $timeout_at) |
956
|
0 |
60 |
unless my $ret = $self->write_timeout($sock, $buf, $len, $off, $timeout_at) |
977
|
3 |
0 |
$! != 0 ? : |
983
|
0 |
36 |
unless setsockopt $sock, 6, 1, 1 |
992
|
0 |
36 |
unless my $flags = fcntl($sock, 3, 0) |
994
|
0 |
36 |
unless $flags = fcntl($sock, 4, $flags | 2048) |
1015
|
0 |
0 |
if ($no_proxy eq '*') { } |
1020
|
0 |
0 |
if ($host =~ /\Q$pat\E$/) |