Branch Coverage

blib/lib/Twiggy/Server.pm
Criterion Covered Total %
branch 41 130 31.5


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
95 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 = readline $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
254 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') { }
324 0 1 if (@$res < 2) { }
0 1 elsif (@$res == 2) { }
341 0 1 if $post
347 0 1 if ($created_writer)
358 2 0 if (ref $res eq 'ARRAY') { }
359 1 1 if (scalar @$res == 0)
371 1 0 if (eval { do { $_[0]->recv; 1 } }) { }
377 1 0 unless eval { do { $cv->send($_[0]->recv); 1 } }
381 0 0 unless eval { do { $cv->send($_[0]->recv); 1 } }
434 1 1 if ((my $written = syswrite($socket, $$data)) < length $$data) { }
1 0 elsif (defined wantarray) { }
439 1 0 if (not defined $written and ($! != 11 and $! != 4 and $! != -1e+99))
441 1 0 if $done
455 0 0 if (defined $out) { }
0 0 elsif ($! != 11 and $! != 4 and $! != -1e+99) { }
458 0 0 if ($written == $length) { }
460 0 0 if $done
465 0 0 if $done
482 1 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')) { }
491 0 0 if (my $pos = $body->tell) { }
527 0 0 if (defined(my $buf = $body->getline)) { }
0 0 elsif ($!) { }
528 0 0 if (length $buf) { }
564 0 0 if (&HAS_AIO() and -s $body) { }
572 0 0 if $ret > 0
573 0 0 if ($offset >= $length or $ret == -1 and not $! == 11 || $! == 4) { }
574 0 0 if ($ret == -1) { }
608 0 0 if $exit
619 0 0 if $exit_guard
622 0 0 if ($handle)