Branch Coverage

blib/lib/File/HTTP.pm
Criterion Covered Total %
branch 1 240 0.4


line true false branch
35 0 1 if (grep {$_ eq "-everywhere";} @_)
147 0 0 if (defined $arg and ref $arg) { }
0 0 elsif ($arg =~ m[^https?://]i) { }
148 0 0 if ($arg->isa('File::HTTP')) { }
0 0 elsif (my $self = tied *$arg) { }
160 0 0 if ($self) { }
183 0 0 if (($dir || '') =~ m[^https?://]) { }
186 0 0 unless ($self)
208 0 0 if (($dir || '') =~ m[^https?://]) { }
211 0 0 unless ($self)
233 0 0 unless ($self->[26])
238 0 0 if (wantarray) { }
239 0 0 if ($self->[27]) { }
252 0 0 unless ($self->[26])
263 0 0 unless ($self->[26])
273 0 0 unless ($self->[26])
284 0 0 unless ($self->[26])
294 0 0 if @_ == 1
298 0 0 if (@_ == 2) { }
0 0 elsif ($file =~ s/^([+<>|]+)\s*//) { }
308 0 0 if (($file || '') =~ m[^https?://]) { }
309 0 0 if ($mode =~ /^\s*<(?:\s*\:raw)?\s*$/) { }
0 0 elsif ($mode =~ /<|\+/) { }
311 0 0 if tie *{$_[0];}, "File::HTTP", $file, 0, \my $err
333 0 0 if (($file || '') =~ m[^https?://]) { }
335 0 0 if tie *{$_[0];}, "File::HTTP", $file, $offset, \my $err
341 0 0 if $offset and $_[0]
348 0 0 unless $url =~ m[^https?://]i
350 0 0 unless ($self)
360 0 0 if (wantarray) { }
379 0 0 $fh ? :
394 0 0 $port == $Proto2Port{$proto} ? :
399 0 0 $type ? :
413 0 0 $fh ? :
431 0 0 unless print $fh $req_headers
433 0 0 unless $self->_read($headers, 5)
435 0 0 unless (defined $headers and $headers eq "HTTP/")
440 0 0 if (not $headers =~ m[^HTTP/[\d\.]+ (\d+)] or &bytes::length($headers) > $MAX_HEADER_SIZE)
447 0 0 unless defined $line
449 0 0 unless $line =~ /\S/
450 0 0 if (++$nb_lines > $MAX_HEADER_LINES or &bytes::length($headers) > $MAX_HEADER_SIZE)
463 0 0 if $self->EOF
465 0 0 if ($self->_connected) { }
466 0 0 if ($self->[5] == $self->[4]) { }
0 0 elsif ($self->[4] > $self->[5] and $self->[4] - $self->[5] < $MAX_LENGTH_SKIP + $self->[21]) { }
474 0 0 unless $self->_read(my $buf, $to_skip) == $to_skip
485 0 0 $REQUEST_HEADERS && ref $REQUEST_HEADERS ? :
486 0 0 defined $self->[4] ? :
494 0 0 if defined $self->[4]
495 0 0 if $self->[20]
500 0 0 unless $self->[10]
502 0 0 if ($self->[17])
512 0 0 unless socket $self->[17], 2, 1, 6
519 0 0 if ($DEBUG_SLOW_CONNECTION and &File::HTTP::time() - $t >= "0.4")
520 0 0 $status ? :
522 0 0 if $status
523 0 0 unless $_ < 3 and $! =~ /Interrupted system call/i
528 0 0 if ($self->[1] eq "HTTPS")
530 0 0 unless ($SSL_LOADED)
531 0 0 unless eval { do { require IO::Socket::SSL; 1 } }
534 0 0 if ($self->[12])
543 0 0 unless $code == 200
559 0 0 if (defined $self->[4]) { }
562 0 0 unless $code == 200
566 0 0 unless ($code_ok)
567 0 0 if ($code =~ /^3/ and $RESPONSE_HEADERS =~ /\015?\012Location: ([^\015\012]+)/i) { }
0 0 elsif (not $IGNORE_ERRORS) { }
568 0 0 unless $IGNORE_REDIRECTIONS
572 0 0 if ($code =~ /^200$|^416$/ and $self->[4] >= $self->[6]) { }
574 0 0 unless CORE::open $self->[17] = undef, "<", "/dev/null"
577 0 0 if $VERBOSE and $code == 200
582 0 0 if ($RESPONSE_HEADERS =~ /\015?\012Transfert-Encoding: +chunked/i and $self->[16] <= 1)
587 0 0 unless (defined $self->[6])
589 0 0 unless (defined $self->[6])
593 0 0 unless (defined $self->[15])
596 0 0 unless (defined $self->[14])
600 0 0 unless defined $self->[4]
612 0 0 if (not defined $off) { }
0 0 elsif ($off < 0) { }
620 0 0 unless $n
622 0 0 if ($self->[22] and $len and $n < $len)
626 0 0 unless $n_part
648 0 0 if ($self->[20])
657 0 0 $self->[7] == $Proto2Port{$self->[1]} ? :
664 0 0 $self->[1] eq 'HTTPS' ? :
665 0 0 if ($proxy)
668 0 0 unless ($self->[2] eq "127.0.0.1" or $self->[2] eq "localhost" or $no_proxy and $self->[2] =~ /$no_proxy$/i)
676 0 0 if ($proxy =~ m[^https://])
677 0 0 if $VERBOSE
692 0 0 if ($@)
693 0 0 if ($@ =~ /^redirection: ([^\n]+)/) { }
0 0 elsif ($@ =~ /^error: (\d+)/) { }
0 0 elsif ($@ =~ /^HTTPS support/) { }
695 0 0 if (++$redirections > $MAX_REDIRECTIONS)
696 0 0 if $VERBOSE
700 0 0 if ($location =~ m[^https?://]i) { }
0 0 elsif ($location =~ m[^//]) { }
0 0 elsif ($location =~ m[^/]) { }
719 0 0 if $VERBOSE
727 0 0 if $VERBOSE
733 0 0 if (defined $self->[4] and not defined $self->[6])
744 0 0 unless $self->_initiate
746 0 0 unless $n
755 0 0 unless $state
757 0 0 unless ($n)
758 0 0 if defined $n
768 0 0 unless $self->_initiate
770 0 0 if (wantarray) { }
784 0 0 if defined $self->[6]
793 0 0 do { $whence == 2 } ? :
0 0 do { $whence == 1 } ? :
0 0 $whence ? :
826 0 0 unless $self->[17]
835 0 0 if $self->[25]
851 0 0 if $self->[13]
852 0 0 unless $self->[14]
853 0 0 unless $TIME_GM_CODE ||= do { if (eval { do { require Time::y2038; 1 } }) { \&Time::y2038::timegm; } elsif (eval { do { require Time::Local; 1 } }) { \&Time::Local::timegm; } }
854 0 0 if (eval { do { require Time::y2038; 1 } }) { }
0 0 elsif (eval { do { require Time::Local; 1 } }) { }
861 0 0 if ($self->[14] =~ /^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat), (\d{1,2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/)