Branch Coverage

blib/lib/Perlbal/ClientHTTP.pm
Criterion Covered Total %
branch 86 126 68.2


line true false branch
75 0 41 if $$self{'closed'}
85 1 62 $not_done_reading ? :
93 40 59 if ($$self{'req_headers'})
94 40 0 if ($$self{'req_headers'}->request_method eq 'PUT') { }
106 3 56 unless my $hd = $self->read_request_headers
123 0 63 if $$self{'service'}->run_hook('start_web_request', $self)
124 1 62 if $$self{'service'}->run_hook('start_http_request', $self)
127 45 17 if ($hd->request_method eq 'GET' or $hd->request_method eq 'HEAD')
134 14 3 if $hd->request_method eq 'PUT'
137 3 0 if $hd->request_method eq 'DELETE'
147 1 13 unless $$self{'service'}{'enable_put'}
149 2 11 $$self{'service'}{'enable_md5'} && $hd->header('Content-MD5') ? :
151 1 12 if $self->handle_put_chunked
161 0 12 if not defined $clen or $clen < 0 or $$self{'service'}{'max_put_size'} and $clen > $$self{'service'}{'max_put_size'}
168 0 11 if ($clen and defined $$self{'read_ahead'} and $$self{'read_ahead'} > 0)
172 0 12 if $$self{'service'}->run_hook('handle_put', $self)
176 0 12 if $uri =~ /\.\./
180 0 12 unless $uri =~ m[^ ((?:/[\w\-\.]+)*) # $1: zero+ path components of /FOO where foo is # one+ conservative characters / # path separator ([\w\-\.]+) # $2: and the filename, one+ conservative characters $]x
200 3 9 if ($$self{'service'}{'min_put_directory'}) { }
201 9 0 if defined $_
202 0 3 unless scalar @elems >= $$self{'service'}{'min_put_directory'}
218 12 1 unless $te and $te eq 'chunked'
221 1 0 if ($eh and $eh =~ /\b100-continue\b/)
229 0 1 if $uri =~ /\.\./
233 0 1 unless $uri =~ m[^ ((?:/[\w\-\.]+)*) # $1: zero+ path components of /FOO where foo is # one+ conservative characters / # path separator ([\w\-\.]+) # $2: and the filename, one+ conservative characters $]x
256 0 32 if ($max_size and $$self{'content_length'} > $max_size)
265 0 32 if $$self{'read_ahead'} >= 1048576
267 14 18 if $$self{'read_ahead'} >= 8192
297 1 2 unless $$self{'service'}{'enable_delete'}
303 0 2 if $uri =~ /\.\./
307 2 0 if ($uri =~ m[^(?:/[\w\-\.]+)+$]) { }
311 1 1 if ($err == 0) { }
1 0 elsif ($! == 2) { }
331 30 10 if (my $cus = $$self{'chunked_upload_state'})
340 0 10 unless (defined $dataref)
352 0 10 if ($$self{'content_length_remain'}) { }
354 0 0 if $$self{'read_ahead'} >= 1048576
356 0 0 if $$self{'read_ahead'} >= 8192
371 1 2 if $VerifiedDirs{$disk_dir}
380 1 1 unless $fh
396 2 11 if ($$self{'md5_ctx'}) { }
412 1 12 unless ($fh)
413 1 0 if ($! == 2) { }
0 0 elsif ($! == 17 and $$self{'put_final_name'}) { }
416 0 1 if $@
435 1 11 unless ($$self{'read_ahead'} or $$self{'content_length_remain'} or $$self{'chunked_upload_state'})
448 0 36 unless ref $self eq 'Perlbal::ClientHTTP'
450 0 36 if $$self{'service'}->run_hook('put_writeout', $self)
451 0 36 if $$self{'put_in_progress'}
452 0 36 unless $$self{'put_fh'}
453 12 24 unless $$self{'read_ahead'}
458 2 22 if $md5_ctx
465 14 10 if $$self{'content_length_remain'} or $$self{'chunked_upload_state'}
472 0 24 if $$self{'closed'}
481 0 24 if ($$self{'read_ahead'})
486 14 10 if $$self{'content_length_remain'} or $$self{'chunked_upload_state'}
500 1 1 if ($actual eq $expect) { }
505 1 0 if ($err == 0) { }
516 1 0 if ($err == 0) { }
528 0 12 if $$self{'put_in_progress'}
529 0 12 unless $$self{'put_fh'}
531 12 0 if (CORE::close $$self{'put_fh'}) { }
534 2 10 if $$self{'md5_ctx'}