Branch Coverage

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


line true false branch
63 0 0 if (defined $val)
74 0 0 if (defined $val)
91 0 0 if ($self->{'DEBUG'})
130 0 4 if (defined $cbargs)
142 0 4 if ($protocol ne 'http')
152 4 0 unless $port
155 4 0 $connecthost ? :
157 4 0 $connectport ? :
159 0 4 unless ($addr)
163 0 4 if ($connecthost ne $host)
172 0 4 if (defined $self->{'local_addr'})
174 0 0 if ($local_addr eq '0.0.0.0' or $local_addr eq '0') { }
180 0 4 if (defined $self->{'local_port'})
184 0 4 unless bind FH, $paddr
187 0 4 unless connect FH, $sin
189 4 0 if ($^O ne 'MSWin32')
193 0 4 if (defined $callback_func)
197 0 4 if ($self->{'header_at_once'})
202 0 4 if ($self->{'HTTP11'}) { }
211 0 4 if ($port != 80) { }
216 4 0 unless (defined $self->get_req_header('Accept'))
220 0 4 if ($method eq 'POST')
236 0 4 if (defined $self->{'content'})
240 0 4 if (defined $callback_func)
242 0 0 if (defined $ncontent_length)
247 0 4 if ($content_length)
251 0 4 if (defined $callback_func)
257 0 4 if ($self->{'header_at_once'})
263 0 4 if (defined $callback_func)
271 0 4 if (not $content_out and defined $self->{'content'})
276 0 4 if (defined $callback_func)
292 0 71 if $self->{'DEBUG'}
293 0 71 if ($self->{'DEBUG'})
302 4 67 if ($line == 1)
305 0 4 if $self->{'DEBUG'}
311 4 63 if ($headmode || $chunkmode eq 'entity-header' and $$data =~ /^[\r\n]*$/)
313 0 4 if ($chunkmode)
321 0 4 if (defined $te)
323 0 0 if ($header =~ /chunked/i)
330 59 4 if ($headmode or $chunkmode eq 'entity-header') { }
0 4 elsif ($chunkmode) { }
333 59 0 if (defined $var)
340 56 3 if (not ref $hr) { }
352 0 0 if ($chunkmode eq 'chunksize') { }
0 0 elsif ($chunkmode eq 'chunk') { }
0 0 elsif ($chunkmode eq 'ignorecrlf') { }
358 0 0 if (length $chunksize > 0) { }
360 0 0 unless ($chunksize =~ /^[a-f0-9]+$/i)
361 0 0 if $self->{'DEBUG'}
364 0 0 if $self->{'DEBUG'}
365 0 0 if ($chunksize == 0) { }
373 0 0 if $self->{'DEBUG'}
379 0 0 if ($chunklength >= $chunksize)
382 0 0 if ($chunklength > $chunksize) { }
0 0 elsif ($chunklength == $chunksize and not $chunk =~ /$CRLF$/) { }
404 0 4 if (defined $callback_func)
419 4 0 if (not defined $data_callback || defined $callback_func) { }
420 0 4 if $self->{'DEBUG'}
424 0 0 if (defined $callback_func) { }
429 0 0 if ($self->{'DEBUG'})
431 0 0 if (ref $newdata eq 'SCALAR')
435 0 0 if (defined $newdata and ref $newdata eq 'SCALAR')
447 0 12 if $self->{'DEBUG'}
466 0 8 if ($exists = defined ${$$self{'headers'};}{lc $header})
515 0 0 unless ($host)
582 0 0 if ($body) { }
592 0 0 unless defined $self->{'headers'}{'Content-Type'} and $self->{'headers'}{'Content-Type'}
601 0 24 if ($self->{'holdback'}) { }
605 0 24 if (defined $self->{'HTTPWriteBuffer'})
623 0 75 if $self->{'DEBUG'}
626 8 67 if ($headmode == 0 and $chunkmode eq '0' or $chunkmode eq 'chunk') { }
627 0 0 $chunksize < $BLOCKSIZE ? :
0 8 $chunkmode eq 'chunk' ? :
634 71 4 if ($res)
635 0 71 if ($self->{'DEBUG'})
651 0 67 if $self->{'DEBUG'}
660 0 4 if ($nfound == 0) { }
667 0 4 if $self->{'DEBUG'}
670 0 4 if ($chars <= 0 and not $!{'EAGAIN'})
681 67 0 if ($nlat > -1) { }
691 67 0 length $newline ? :
700 0 8 if $self->{'DEBUG'}
709 0 23 if ($nfound == 0) { }
716 0 23 if $self->{'DEBUG'}
719 8 15 if ($chars <= 0 and not $!{'EAGAIN'})
728 0 8 if (($buflen = length $self->{'HTTPReadBuffer'}) >= $bytes) { }
731 0 0 if ($bytes + 1 < $buflen) { }
740 4 4 length $newline ? :
746 104 0 if (defined $str) { }