Branch Coverage

blib/lib/LWPx/Protocol/http_paranoid.pm
Criterion Covered Total %
branch 33 128 25.7


line true false branch
25 0 26 unless defined $LWPx::Protocol::http_paranoid::TOO_LATE
27 0 26 if $LWPx::Protocol::http_paranoid::TIME_REMAIN < 0
35 0 9 if ($conn_cache)
36 0 0 if (my $sock = $conn_cache->withdraw('http', "${host}:$port"))
37 0 0 if $sock and not $sock->can_read(0)
46 0 7 unless (@addrs)
57 0 7 $request->{'_timebegin'} ? :
69 0 7 unless ($sock)
90 7 0 if (defined(my $peerhost = $sock->peerhost))
101 0 7 if ($hhost =~ s/^([^\@]*)\@//)
105 0 0 if (defined $1 and not $h->header('Authorization'))
119 0 0 unless lc $hlist->[$i] eq $k
133 9 0 if ($timeout)
142 0 9 unless ($method =~ /^[A-Za-z0-9_!\#\$%&\'*+\-.^\`|~]+$/)
154 0 9 unless $fullpath =~ m[^/]
171 0 7 if ref $$content_ref
175 0 7 if (ref $content_ref eq 'CODE') { }
177 0 0 if $clen
178 0 0 unless (defined $clen)
187 0 7 if (defined $$content_ref and length $$content_ref) { }
0 7 elsif ($clen) { }
189 0 0 if (not defined $clen or $clen ne length $$content_ref)
190 0 0 if (defined $clen)
210 0 7 unless defined $n
211 0 7 unless $n == length $req_buf
218 0 7 if ($has_content)
220 0 0 if ($request_headers->header('Expect') || '') =~ /100-continue/
226 0 0 if (ref $content_ref eq 'CODE') { }
228 0 0 unless defined $buf
229 0 0 if $chunked
246 0 0 if ($now > $LWPx::Protocol::http_paranoid::TOO_LATE)
251 0 0 if ($write_wait)
253 0 0 if $write_wait < $sel_timeout
257 0 0 $write_wait ? :
259 0 0 unless (defined $nfound)
263 0 0 if ($write_wait)
265 0 0 if $write_wait < 0
268 0 0 if (defined $rbits and $rbits =~ /[^\0]/)
275 0 0 unless ($n)
279 0 0 if ($buf =~ /\015?\012\015?\012/)
284 0 0 if ($code eq '100') { }
295 0 0 if (defined $wbits and $wbits =~ /[^\0]/)
297 0 0 unless ($n)
298 0 0 unless defined $n
303 0 0 if (not $eof and $woffset >= length $$wbuf)
306 0 0 unless defined $buf
307 0 0 unless length $buf
308 0 0 if $chunked
318 7 0 unless $code
320 0 7 if $code eq '100'
330 0 7 if @junk
335 0 7 if ($method eq 'CONNECT')
340 0 7 if (my(@te) = $response->remove_header('Transfer-Encoding'))
353 0 12 unless defined $n
354 0 12 if $n == -1
356 7 5 unless $n
359 0 7 unless $complete
369 7 0 unless ($drop_connection)
370 0 7 if (my $conn_cache = $self->{'ua'}{'conn_cache'})
373 0 0 if ($peer_http_version eq '1.1' and not $connection{'close'} or $connection{'keep-alive'})
393 19 0 if (defined $timeout) { }
394 0 19 unless $self->can_read($timeout)
399 0 0 unless $self->can_read(undef)
409 0 38 unless defined $nfound