Branch Coverage

blib/lib/CPANPLUS/Internals/Source/MetaCPAN/HTTP.pm
Criterion Covered Total %
branch 71 178 39.8


line true false branch
66 0 0 if (defined $val)
77 0 0 if (defined $val)
94 0 0 if ($$self{'DEBUG'})
133 0 4 if (defined $cbargs)
145 0 4 if ($protocol ne 'http')
155 4 0 unless $port
158 4 0 $connecthost ? :
160 4 0 $connectport ? :
162 0 4 unless ($addr)
166 0 4 if ($connecthost ne $host)
175 0 4 if (defined $$self{'local_addr'})
177 0 0 if ($local_addr eq '0.0.0.0' or $local_addr eq '0') { }
183 0 4 if (defined $$self{'local_port'})
187 0 4 unless bind FH, $paddr
190 0 4 unless connect FH, $sin
192 4 0 if ($^O ne 'MSWin32')
196 0 4 if (defined $callback_func)
200 0 4 if ($$self{'header_at_once'})
205 0 4 if ($$self{'HTTP11'}) { }
214 0 4 if ($port != 80) { }
219 4 0 unless (defined $self->get_req_header('Accept'))
223 0 4 if ($method eq 'POST')
239 0 4 if (defined $$self{'content'})
243 0 4 if (defined $callback_func)
245 0 0 if (defined $ncontent_length)
250 0 4 if ($content_length)
254 0 4 if (defined $callback_func)
260 0 4 if ($$self{'header_at_once'})
266 0 4 if (defined $callback_func)
274 0 4 if (not $content_out and defined $$self{'content'})
279 0 4 if (defined $callback_func)
294 0 47 if $$self{'DEBUG'}
296 0 47 if ($$self{'DEBUG'})
305 4 43 if ($line == 1)
308 0 4 if $$self{'DEBUG'}
314 4 39 if ($headmode || $chunkmode eq 'entity-header' and $$data =~ /^[\r\n]*$/)
316 0 4 if ($chunkmode)
324 0 4 if (defined $te)
326 0 0 if ($header =~ /chunked/i)
333 28 11 if ($headmode or $chunkmode eq 'entity-header') { }
0 11 elsif ($chunkmode) { }
336 28 0 if (defined $var)
343 28 0 if (not ref $hr) { }
355 0 0 if ($chunkmode eq 'chunksize') { }
0 0 elsif ($chunkmode eq 'chunk') { }
0 0 elsif ($chunkmode eq 'ignorecrlf') { }
361 0 0 if (length $chunksize > 0) { }
363 0 0 unless ($chunksize =~ /^[a-f0-9]+$/i)
364 0 0 if $$self{'DEBUG'}
367 0 0 if $$self{'DEBUG'}
368 0 0 if ($chunksize == 0) { }
376 0 0 if $$self{'DEBUG'}
382 0 0 if ($chunklength >= $chunksize)
385 0 0 if ($chunklength > $chunksize) { }
0 0 elsif ($chunklength == $chunksize and not $chunk =~ /$CRLF$/) { }
407 0 4 if (defined $callback_func)
422 11 0 if (not defined $data_callback || defined $callback_func) { }
423 0 11 if $$self{'DEBUG'}
427 0 0 if (defined $callback_func) { }
432 0 0 if ($$self{'DEBUG'})
434 0 0 if (ref $newdata eq 'SCALAR')
438 0 0 if (defined $newdata and ref $newdata eq 'SCALAR')
450 0 12 if $$self{'DEBUG'}
469 0 8 if ($exists = defined ${$$self{'headers'};}{lc $header})
518 0 0 unless ($host)
585 0 0 if ($body) { }
593 0 0 unless defined $$self{'headers'}{'Content-Type'} and $$self{'headers'}{'Content-Type'}
604 0 24 if ($$self{'holdback'}) { }
608 0 24 if (defined $$self{'HTTPWriteBuffer'})
626 0 51 if $$self{'DEBUG'}
629 15 36 if ($headmode == 0 and $chunkmode eq '0' or $chunkmode eq 'chunk') { }
630 0 0 $chunksize < $BLOCKSIZE ? :
0 15 $chunkmode eq 'chunk' ? :
637 47 4 if ($res)
638 0 47 if ($$self{'DEBUG'})
654 0 36 if $$self{'DEBUG'}
663 0 4 if ($nfound == 0) { }
670 0 4 if $$self{'DEBUG'}
673 0 4 if ($chars <= 0 and not $!{'EAGAIN'})
684 36 0 if ($nlat > -1) { }
694 36 0 length $newline ? :
703 0 15 if $$self{'DEBUG'}
712 0 30 if ($nfound == 0) { }
719 0 30 if $$self{'DEBUG'}
722 8 22 if ($chars <= 0 and not $!{'EAGAIN'})
731 7 8 if (($buflen = length $$self{'HTTPReadBuffer'}) >= $bytes) { }
734 7 0 if ($bytes + 1 < $buflen) { }
743 11 4 length $newline ? :
749 40 0 if (defined $str) { }