Branch Coverage

blib/lib/Hijk.pm
Criterion Covered Total %
branch 63 146 43.1


line true false branch
24 4 8 if defined $read_timeout and $read_timeout <= 0
28 2 10 $head_as_array ? :
35 0 26 if _select($rin, undef, undef, $read_timeout) != 1 or defined $read_timeout and $read_timeout <= 0
39 2 9 if $no_content_len and $decapitated and !defined($nbytes) || $nbytes == 0
41 0 24 unless (defined $nbytes)
42 0 0 if $! == 11 or $! == 11 or $! == 4
44 0 0 $decapitated ? :
52 5 19 if ($nbytes == 0)
54 0 5 $decapitated ? :
60 9 10 if ($decapitated) { }
62 0 9 unless ($no_content_len)
69 7 3 if ($neck_pos > 0)
75 0 7 if $status_code == 204
86 3 42 if ($key eq 'Transfer-Encoding' and $value eq 'chunked') { }
2 40 elsif ($key eq 'Content-Length') { }
2 38 elsif ($key eq 'Connection' and $value eq 'close') { }
2 72 elsif ($key eq 'Trailer' and $value) { }
96 13 32 if ($head_as_array) { }
109 2 5 if ($doing_chunked and $trailer_value_is_true)
113 3 4 if ($doing_chunked)
114 0 3 unless $parse_chunked
124 1 1 $header->{'Trailer'} ? :
1 2 $head_as_array ? :
129 2 2 if (defined $content_length) { }
130 0 2 if ($content_length == 0) { }
154 0 23 if (length $buf == 0 or length $buf < $chunk_size)
155 0 0 if _select($rin, undef, undef, $read_timeout) != 1 or defined $read_timeout and $read_timeout <= 0
159 0 0 unless (defined $nbytes)
160 0 0 if $! == 11 or $! == 11 or $! == 4
170 0 0 if ($nbytes == 0)
180 2 21 if ($trailer_mode) { }
200 2 0 if ($neck_pos > 0)
204 9 12 if ($chunk_size > 0 and length $buf >= $chunk_size) { }
210 12 0 if ($neck_pos > 0)
212 3 9 if ($chunk_size == 0) { }
213 2 1 if ($true_trailer_header) { }
236 0 0 unless defined $inet_aton
242 0 0 unless socket $soc, 2, 1, $tcp_proto
243 0 0 unless my $flags = fcntl($soc, 3, 0)
244 0 0 unless fcntl $soc, 4, $flags | 2048
246 0 0 if (not connect($soc, $addr) and $! != 115)
250 0 0 if defined $connect_timeout and $connect_timeout <= 0
252 0 0 if (_select(undef, $rout, undef, $connect_timeout) != 1)
253 0 0 if (defined $connect_timeout) { }
268 0 0 if ($! = unpack('L', getsockopt($soc, 1, 4)))
277 4 32 defined $args->{'query_string'} ? :
291 8 28 $args->{'no_default_host_header'} ? :
8 28 defined $args->{'body'} ? :
10 26 $args->{'head'} && @{$args->{'head'};} ? :
8 28 defined $args->{'body'} ? :
301 0 0 if exists $args->{'timeout'}
305 0 0 unless exists $args->{'socket_cache'}
308 0 0 unless exists $args->{'read_length'}
312 0 0 if defined $args->{'socket_cache'}
315 0 0 if (defined $cache_key and exists $args->{'socket_cache'}{$cache_key}) { }
319 0 0 if $error
320 0 0 if defined $cache_key
321 0 0 if exists $args->{'on_connect'}
330 0 0 if (_select(undef, $rout, undef, undef) != 1)
331 0 0 if defined $cache_key
341 0 0 unless (defined $rc)
342 0 0 if $! == 11 or $! == 11 or $! == 4
343 0 0 if defined $cache_key
360 0 0 unless (eval { do { ($close_connection, $proto, $status, $head, $body, $error, $error_message, $errno_number, $errno_string) = _read_http_message(fileno $soc, @$args{'read_length', 'read_timeout', 'parse_chunked', 'head_as_array', 'method'}); 1 } })
362 0 0 if defined $cache_key
367 0 0 if ($status == 0 or $close_connection or defined $proto and $proto eq 'HTTP/1.0')
376 0 0 if defined $cache_key
380 0 0 defined $error ? :
0 0 defined $error_message ? :
0 0 defined $errno_number ? :
0 0 defined $errno_string ? :
396 10 27 if ($nfound == -1 and $! == 4)
397 10 0 if $timeout