Branch Coverage

blib/lib/App/HTTP_Proxy_IMP/IMP.pm
Criterion Covered Total %
branch 6 316 1.9


line true false branch
47 0 2 unless delete $args{'mod'}
48 2 0 if (ref $module)
55 0 0 unless my($mod, $args) = $module =~ /^([a-z][\w:]*)(?:=(.*))?$/i
57 0 0 unless eval "require $mod"
59 0 0 unless my $factory = $mod->new_factory(%args)
61 0 0 unless $factory = $factory->get_interface($interface) && $factory->set_interface($interface)
68 0 2 unless @factory
69 0 2 if (@factory > 1)
72 0 0 unless my $cascade = 'Net::IMP::Cascade'->new_factory('parts', [@factory])
74 0 0 unless $cascade = $cascade->set_interface($interface)
91 2 2 unless $_ ~~ [4113, 4112]
149 0 0 unless ($METHODS_WITHOUT_RQBODY{$xhdr->{'method'}})
150 0 0 if (not defined $clen and $xhdr->{'method'} ne 'CONNECT')
159 0 0 if defined $size
161 0 0 if (my $pass = $self->{'pass'}[0])
162 0 0 if ($pass == -1 or $pass >= $hlen + $clen)
167 0 0 if (my $prepass = $self->{'prepass'}[0])
168 0 0 if ($prepass == -1 or $prepass >= $hlen + $clen)
173 0 0 if ($self->{'ibuf'}[0][0][0] >= $hlen + $clen)
184 0 0 unless (defined $size)
197 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
199 0 0 unless $$hdr =~ s/^(Content-length:[ \t]*)(\d+)/$1$size/im
221 0 0 if ($changed)
242 0 0 $bad ? :
0 0 $internal ? :
256 0 0 $METHODS_WITHOUT_RQBODY{$xhdr->{'method'}} ? :
268 0 0 unless my $sub = $self->{'fixup_header'}[0]
270 0 0 if $ok
283 0 0 if $data eq ''
292 0 0 if $data ne '' or $eof
304 0 0 if (my $ce = $xhdr->{'fields'}{'content-encoding'})
309 0 0 if %ce
332 0 0 if ($changed)
345 0 0 $bad ? :
362 0 0 if ($CODE_WITHOUT_RPBODY{$xhdr->{'code'}} or $xhdr->{'code'} < 200)
369 0 0 if ($METHODS_WITHOUT_RPBODY{$self->{'method'}})
386 0 0 if (my $pass = $self->{'pass'}[1])
387 0 0 if ($pass == -1 or $pass >= $rpsize)
393 0 0 if (my $prepass = $self->{'prepass'}[1])
394 0 0 if ($prepass == -1 or $prepass >= $rpsize)
400 0 0 if ($self->{'ibuf'}[1][0][0] >= $rpsize)
420 0 0 if ($self->{'decode'}{'-5242892'}[1])
421 0 0 if ($nochange) { }
428 0 0 if ($pass and defined $orig_clen and $pass == -1 || $pass >= $orig_clen + $orig_hlen)
443 0 0 if (defined $clen)
461 0 0 if $data eq ''
470 0 0 if $data ne '' or $eof
480 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
509 0 0 if $data eq ''
519 0 0 if $data ne '' or $eof
535 0 0 unless my $request = $self->{'request'}
540 0 0 if ($rtype == 4352)
542 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
547 0 0 if ($rtype == 1)
549 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
550 0 0 if (my $sub = $self->{'logsub'})
557 0 0 if ($rtype == 4)
559 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
565 0 0 if ($rtype ~~ [4097, 4099])
567 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
569 0 0 if ($rtype == 4097) { }
571 0 0 if ($self->{'pass'}[$dir] == -1) { }
0 0 elsif ($offset == -1 or $offset > $self->{'ibuf'}[$dir][0][0]) { }
586 0 0 if ($self->{'pass'}[$dir] == -1 or $self->{'prepass'}[$dir] == -1) { }
0 0 elsif ($offset == -1 or $offset > $self->{'ibuf'}[$dir][0][0]) { }
589 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
595 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
598 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
613 0 0 unless defined $ib0->[2]
615 0 0 if ($offset == -1) { }
621 0 0 if ($pass > $len0) { }
0 0 elsif ($pass == $len0) { }
0 0 elsif ($ib0->[2] < 0) { }
630 0 0 if (@$ibuf) { }
0 0 elsif ($ib0->[2] < 0) { }
661 0 0 if (@$ibuf) { }
676 0 0 if ($rtype == 4113)
678 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
681 0 0 unless @$ibuf
687 0 0 if $self->{'pass'}[$dir] or $self->{'prepass'}[$dir]
690 0 0 if $offset == -1
700 0 0 if ($rlen < 0) { }
0 0 elsif ($rlen > $len0) { }
0 0 elsif ($rlen < $len0) { }
703 0 0 if @$ibuf > 1 or $ib0->[2] > 0
709 0 0 if $ib0->[2] > 0
713 0 0 if $rlen
717 0 0 if (@$ibuf > 1) { }
0 0 elsif ($ib0->[2] < 0) { }
739 0 0 if ($rtype ~~ [16, 17])
742 0 0 if ($relay and my $fo = $relay->fd($dir))
743 0 0 $rtype == 16 ? :
748 0 0 if ($rtype == 4354)
756 0 0 unless %fwd
780 0 0 if (my $decode = $self->{'decode'}{$type + 0}[$dir])
782 0 0 unless (ref $decode)
792 0 0 if $offset
794 0 0 if $self->{'pass_encoded'}[$dir]
796 0 0 unless defined($data = &$decode($data))
799 0 0 if ($offset)
800 0 0 if $offset < $eobuf
801 0 0 if $offset == $eobuf
808 0 0 if ($pass)
811 0 0 if $ibuf->[0][2]
813 0 0 if ($pass == -1)
816 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
821 0 0 if ($canpass <= 0) { }
0 0 elsif ($canpass >= $dlen) { }
0 0 elsif ($type < 0) { }
827 0 0 if ($data eq '')
830 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
834 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
839 0 0 if $self->{'pass_encoded'}[$dir]
845 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
853 0 0 if ($prepass)
856 0 0 if $ibuf->[0][2]
857 0 0 if ($prepass == -1)
860 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
866 0 0 if ($canprepass <= 0) { }
0 0 elsif ($canprepass >= $dlen) { }
0 0 elsif ($type < 0) { }
874 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
879 0 0 if $self->{'pass_encoded'}[$dir]
885 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
894 0 0 if ($offset and $offset > $eobuf)
895 0 0 if defined $ibuf->[0][2]
898 0 0 if (not defined $ibuf->[-1][2]) { }
0 0 elsif ($type < 0 and $type == $ibuf->[-1][2] and $callback == $ibuf->[-1][3]) { }
911 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
915 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
937 0 0 if ($3 eq '') { }
948 0 0 if (pos $hdr // 0 != length $hdr)
951 0 0 if $hdr =~ s/\A([^\n]*)\n//
962 0 0 unless $typ ~~ ['gzip', 'deflate']
972 0 0 if defined $inflate
976 0 0 $data eq '' ? :
977 0 0 if ($typ eq 'gzip') { }
980 0 0 if length $buf < $hdr_len
982 0 0 if ($magic != 35615 or $method != Z_DEFLATED() or $flags & 224)
983 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG
987 0 0 if ($flags & 4)
989 0 0 if length $buf < ($hdr_len += 2)
991 0 0 if length $buf < $hdr_len
993 0 0 if ($flags & 8)
996 0 0 if $o == -1
999 0 0 if ($flags & 16)
1002 0 0 if $o == -1
1005 0 0 if ($flags & 2)
1007 0 0 if length $buf < ($hdr_len += 2)
1024 0 0 if length $buf < 2
1026 0 0 if (($magic & 15) == 8 and $magic >> 4 <= 7 and unpack('n', substr($buf, 0, 2)) % 31 == 0) { }
1039 0 0 unless $inflate = 'Compress::Raw::Zlib::Inflate'->new('-WindowBits', $wb, '-AppendOutput', 1, '-ConsumeInput', 1)
1045 0 0 if $buf eq ''
1049 0 0 unless ($inflate)
1061 0 0 if ($stat == Z_STREAM_END()) { }
0 0 elsif ($stat != Z_OK()) { }
1062 0 0 if ($gzip_csum and length $buf >= $gzip_csum)
1068 0 0 if $App::HTTP_Proxy_IMP::IMP::DEBUG