Branch Coverage

blib/lib/Twiggy/Server.pm
Criterion Covered Total %
branch 38 126 30.1


line true false branch
44 1 0 unless $$self{'listen'}
67 1 0 if ($listen =~ /:\d+$/) { }
69 0 1 if $host eq ''
70 0 1 if $port == 0
91 0 1 if $$self{'server_ready'}
108 0 2 unless $sock
111 2 0 if ($is_tcp and $$self{'no_delay'})
112 0 2 unless setsockopt $sock, 6, 1, 1
118 1 0 if ($self->_try_read_headers($sock, $headers))
140 0 1 if ($reqlen < 0) { }
151 1 1 unless (eval { do { if (my $env = &$try_parse()) { $self->_run_app($app, $env, $sock); } else { $self->_create_req_parsing_watcher($sock, $try_parse, $app); } ; 1 } })
152 1 0 if (my $env = &$try_parse()) { }
178 4 1 if (defined(my $line = <$sock>)) { }
0 1 elsif ($! and ($! != 11 and $! != 4 and $! != -1e+99)) { }
1 0 elsif (not $!) { }
181 1 3 if ($line eq "\r\n" or $line eq "\n") { }
209 0 0 if $$self{'timeout'}
213 0 0 if (my $env = &$try_parse())
230 0 1 unless defined $sock and defined fileno $sock
239 1 0 if $disconnected
253 0 0 $remaining > $read_chunk_size ? :
257 0 0 if (defined $rlen and $rlen > 0) { }
0 0 elsif (defined $rlen) { }
0 0 elsif ($! and ($! != 11 and $! != 4 and $! != -1e+99)) { }
0 0 elsif (not $!) { }
260 0 0 if ($remaining <= 0) { }
279 0 0 unless (&$try_read())
282 0 0 if (&$try_read())
296 1 0 unless ($$env{'psgi.input'})
297 0 1 if ($$env{'CONTENT_LENGTH'}) { }
312 0 1 if (ref $res eq 'ARRAY') { }
0 1 elsif (blessed $res and $res->isa('AnyEvent::CondVar')) { }
1 0 elsif (ref $res eq 'CODE') { }
322 0 1 if (@$res < 2) { }
0 1 elsif (@$res == 2) { }
338 0 1 if $post
351 2 0 if (ref $res eq 'ARRAY') { }
352 1 1 if (scalar @$res == 0)
364 0 1 if (eval { do { $_[0]->recv; 1 } }) { }
370 0 0 unless eval { do { $cv->send($_[0]->recv); 1 } }
374 1 0 unless eval { do { $cv->send($_[0]->recv); 1 } }
427 1 0 if ((my $written = syswrite($socket, $$data)) < length $$data) { }
0 0 elsif (defined wantarray) { }
432 0 0 if (not defined $written and ($! != 11 and $! != 4 and $! != -1e+99))
434 0 0 if $done
448 0 1 if (defined $out) { }
1 0 elsif ($! != 11 and $! != 4 and $! != -1e+99) { }
451 0 0 if ($written == $length) { }
453 0 0 if $done
458 1 0 if $done
475 0 0 if (ref $body eq 'ARRAY') { }
0 0 elsif (&Plack::Util::is_real_fh($body)) { }
0 0 elsif (blessed $body and $body->can('string_ref')) { }
484 0 0 if (my $pos = $body->tell) { }
520 0 0 if (defined(my $buf = $body->getline)) { }
0 0 elsif ($!) { }
521 0 0 if (length $buf) { }
557 0 0 if (HAS_AIO and -s $body) { }
565 0 0 if $ret > 0
566 0 0 if ($offset >= $length or $ret == -1 and not $! == 11 || $! == 4) { }
567 0 0 if ($ret == -1) { }
610 0 0 if $exit_guard
613 0 0 if ($handle)