Branch Coverage

blib/lib/Starman/Server.pm
Criterion Covered Total %
branch 100 160 62.5


line true false branch
38 0 101 if ($options->{'net_server_args'})
42 0 101 if ($options->{'pid'})
45 0 101 if ($options->{'daemonize'})
48 0 101 if ($options->{'error_log'})
54 14 87 if ($options->{'ssl_cert'})
57 14 87 if ($options->{'ssl_key'})
60 101 0 unless (exists $options->{'keepalive'})
63 101 0 unless (exists $options->{'keepalive_timeout'})
66 101 0 unless (exists $options->{'read_timeout'})
69 101 0 unless (exists $options->{'proctitle'})
74 101 0 unless $options->{'listen'}
76 101 0 if ($listen =~ /:/) { }
78 101 0 if $h
80 0 101 if defined $opt and lc $opt eq "ssl"
106 14 87 $options->{'ssl'} ? :
101 0 $^O =~ /(linux|darwin|bsd|cygwin)$/ ? :
118 0 87 $port->{'proto'} eq 'unix' ? :
14 87 $port->{'proto'} eq 'ssl' ? :
126 0 101 if $self->{'options'}{'server_ready'}
138 0 14 if ($quit)
145 0 0 unless keys %{$$self{"server"}{"children"};}
156 31 0 unless $self->{'options'}{'argv'}
157 31 0 if $self->{'options'}{'proctitle'}
172 0 87 if ($self->{'options'}{'psgi_app_builder'})
176 87 0 unless $self->{'options'}{'argv'}
177 87 0 if $self->{'options'}{'proctitle'}
197 5 84 if (ref $res eq 'CODE') { }
208 63 2 if ($conn->NS_proto eq "TCP")
209 0 63 unless setsockopt $conn, 6, 1, 1
214 0 136 unless $conn->connected
217 47 89 unless $self->_read_headers
238 2 87 $conn->NS_proto eq 'SSL' ? :
242 0 89 if ($reqlen == -1)
253 0 89 if ($proto and $proto eq 'HTTP/1.0') { }
89 0 elsif ($proto and $proto eq 'HTTP/1.1') { }
254 0 0 if ($connection and $connection =~ /^keep-alive$/i) { }
263 0 89 if ($connection and $connection =~ /^close$/i) { }
272 1 88 if ($env->{'HTTP_EXPECT'})
273 1 0 if (lc $env->{'HTTP_EXPECT'} eq '100-continue') { }
284 0 89 unless ($env->{'HTTP_HOST'})
292 0 89 unless ($self->{'options'}{'keepalive'})
303 71 18 if ($self->{'client'}{'keepalive'})
305 0 71 if ($self->{'client'}{'inputbuf'} ne "")
306 0 0 if ($self->{'client'}{'inputbuf'} =~ /^(?:GET|HEAD)/) { }
329 0 71 unless $sel->can_read($self->{'options'}{'keepalive_timeout'})
348 89 138 if $self->{'client'}{'inputbuf'} ne "" and $self->{'client'}{'inputbuf'} =~ /$Starman::Server::CR?$Starman::Server::LF$Starman::Server::CR?$Starman::Server::LF/s
353 47 91 if (not defined $read or $read == 0)
367 47 89 if ($@)
368 0 47 if ($@ =~ /Timed out/)
373 47 0 if ($@ =~ /Read error/)
408 3 15 if ($self->{'client'}{'inputbuf'} ne "")
418 4 86 if ($chunked) { }
4 82 elsif (my $cl = $env->{'CONTENT_LENGTH'}) { }
432 4 24 if ($chunk_len == 0) { }
1 23 elsif (length $chunk_buffer < $chunk_len + 2) { }
445 0 9 unless $read and $read > 0
455 0 5 if (not defined $read or $read == 0)
471 18 71 if ($env->{'psgix.harakiri.commit'})
489 0 101 if $k eq "Connection"
494 89 0 if ($protocol eq 'HTTP/1.1') { }
495 84 5 if (not exists $headers{'content-length'}) { }
0 5 elsif (my $te = $headers{'transfer-encoding'}) { }
496 82 2 if (not $status =~ /^1\d\d|[23]04$/ and $env->{'REQUEST_METHOD'} ne "HEAD")
503 0 0 if ($te eq "chunked")
509 0 0 unless (exists $headers{'content-length'})
515 89 0 unless ($headers{'date'})
520 71 18 if ($self->{'client'}{'keepalive'}) { }
532 85 4 if (defined $res->[2]) { }
535 81 5 if ($chunked)
537 0 81 unless $len
542 78 7 if $chunked
547 6 0 if ($chunked)
549 1 5 unless $len
555 4 0 if $chunked
569 0 264 unless (defined $len)
570 0 0 if $! == 32
571 0 0 if $! == 104
572 0 0 if $! == 4
586 153 4 if defined $len or $! != 4
606 18 47 if ($self->{'client'}{'harakiri'})