Branch Coverage

blib/lib/Perlbal/ClientHTTPBase.pm
Criterion Covered Total %
branch 130 226 57.5


line true false branch
71 5 67 unless ref $self
101 0 69 if $$self{'closed'}
107 0 69 if $$self{'reproxy_fh'}
132 1 207 if defined $override_value
137 149 59 if ($do_keepalive) { }
141 149 0 $timeout ? :
156 0 5 if ($self->state eq 'persist_wait') { }
175 59 149 if (not defined $$self{'res_headers'} && $$self{'res_headers'}->res_keep_alive($$self{'req_headers'}) or $$self{'do_die'})
194 75 74 if ($$self{'req_headers'}->request_method eq 'POST')
220 64 85 if (my $selector_svc = $$self{'selector_svc'})
221 64 0 unless ($selector_svc->run_hook('return_to_base', $self))
237 39 0 if (@_)
247 39 0 if (not $is_ssl_webserver) { }
249 0 39 if $$self{'service'}->run_hook('start_send_file', $self)
255 0 0 if $Perlbal::DEBUG >= 3
264 0 0 unless $_[0] > 0
289 0 88 if $$self{'req_headers'}
300 23 89 unless $hd
304 0 89 if $$self{'service'}->run_hook('start_http_request', $self)
318 0 89 unless ref $selector eq 'CODE'
324 0 89 if ($$svc{'latency'}) { }
333 0 39 if $$self{'service'}->run_hook('reproxy_fh_finished', $self)
337 8 31 if (my $cb = $$self{'post_sendfile_cb'}) { }
350 39 0 if $$self{'reproxy_file_offset'} == 0
353 0 39 if ($$self{'is_ssl'})
354 0 0 if $$self{'closed'}
355 0 0 if ($remain <= 0)
362 0 0 $remain > 4096 ? :
370 0 0 if $$self{'closed'}
373 0 0 if (not defined $rv or $rv <= 0)
390 0 39 $remain > 131072 ? :
393 0 39 if $$self{'closed'}
401 0 39 if ($sent < 0)
402 0 0 if $! == 32
403 0 0 if $! == 104
410 39 0 if ($sent >= $remain) { }
421 0 39 if ($to_send < 0)
444 39 0 if ($$self{'reproxy_fh'})
450 0 0 if ($self->write(undef))
464 0 46 unless ($rm eq 'HEAD' or $rm eq 'GET')
472 0 46 if $$self{'service'}->run_hook('start_serve_request', $self, \$uri)
475 1 45 if ($uri =~ m[/\.\./] or not $uri =~ m[^/])
483 9 36 if $uri =~ /\?\?/
488 0 36 unless $$svc{'docroot'}
498 0 36 if $$self{'closed'}
499 2 34 unless (-e _)
500 0 2 if $$self{'service'}->run_hook('static_get_poststat_file_missing', $self)
512 0 34 if ($ims and $ims =~ s/; length=(\d+)//)
520 27 7 if -f _
523 0 34 if $ims_len and $ims_len != $size
527 1 33 if ($not_mod) { }
0 33 elsif ($status == 416) { }
0 33 elsif ($status == 206) { }
531 0 0 $size ? :
538 0 33 if $$self{'service'}->run_hook('static_get_poststat_pre_send', $self, $mtime)
544 33 1 if $$self{'service'}{'server_tokens'}
547 27 7 if (-f _) { }
7 0 elsif (-d _) { }
551 26 1 unless ($not_mod or $not_satisfiable)
553 26 0 defined $ext && exists $$MimeType{$ext} ? :
556 26 0 if (not $status == 206) { }
567 0 27 if $$self{'service'}->run_hook('modify_response_headers', $self)
569 1 25 if ($rm eq 'HEAD' or $not_mod or $not_satisfiable)
585 0 25 if ($$self{'closed'})
586 0 0 if $rp_fh
591 0 25 unless ($rp_fh)
602 0 25 if ($status == 206)
629 1 8 unless ($base =~ m[/$])
638 0 8 unless $$svc{'docroot'}
643 1 7 unless $$svc{'enable_concatenate_get'}
644 0 7 if @multiple_files > 100
645 0 7 if grep {m[(?:\A|/)\.\./];} @multiple_files
652 4 17 $! ? :
653 14 7 if $remain or $$self{'closed'}
664 1 6 unless (S_ISDIR($$stats{''}[2] || 0))
674 1 11 unless (S_ISREG($$stat[2] || 0))
675 0 1 if $$self{'service'}->run_hook('concat_get_poststat_file_missing', $self)
678 6 0 if (not $mime and $f =~ /\.(\w+)$/ and $$MimeType{$1})
682 6 5 if $$stat[9] > $most_recent_mod
694 0 5 if ($ims and $ims =~ s/; length=(\d+)//)
702 1 4 if ($not_mod) { }
705 0 4 if $$self{'service'}->run_hook('concat_get_poststat_pre_send', $self, $most_recent_mod)
711 5 0 if $$self{'service'}{'server_tokens'}
716 0 5 if $$self{'service'}->run_hook('modify_response_headers', $self)
718 1 4 if ($hd->request_method eq 'HEAD' or $not_mod)
734 4 8 unless (@remain)
747 0 8 if ($$self{'closed'})
748 0 0 if $rp_fh
753 0 8 unless ($rp_fh)
770 0 295 if ($$self{'service'}->trusted_ip($self->peer_ip_string))
788 0 15 unless $$self{'service'}{'index_files'}
6 9 if ($filepos >= scalar @{[] unless $$self{'service'}{'index_files'};})
789 5 1 unless ($$self{'service'}{'dirindexing'})
805 2 2 if (-d "$file/$de") { }
831 0 9 if $$self{'closed'}
832 8 1 unless -f _
847 33 1 if ($code != 204 and $code != 304)
850 32 1 $en ? :
851 17 16 if $msg
855 33 1 if $$self{'service'}{'server_tokens'}
862 33 1 if (defined $body)
863 33 0 unless ($$self{'req_headers'} and $$self{'req_headers'}->request_method eq 'HEAD')
885 0 1 ref $_[0] eq 'SCALAR' ? :
895 0 1 if ($code == 204 or $code == 304) { }
1 0 elsif (defined $$bref) { }
902 1 0 if $$self{'service'}{'server_tokens'}
911 1 0 if (defined $$bref and $$self{'req_headers'} and $$self{'req_headers'}->request_method ne 'HEAD')
939 0 0 unless $@
948 0 0 $$self{'sock'} ? :
949 0 0 $name ? :
951 0 0 if $lport
952 0 0 if defined $observed
957 0 0 if (defined $hd)