Condition Coverage

blib/lib/Monoceros/Server.pm
Criterion Covered Total %
condition 99 236 41.9


and 3 conditions

line !l l&&!r l&&r condition
101 70 10 3 exists $args{'keepalive'} && !$args{'keepalive'}
135 0 0 83 $^O eq "linux" and not $self->{'use_unix_domain'}
244 83 0 47 $stats eq $prev_stats and @_
282 0 0 12 $close_all && $i < 4
295 12 0 32 $kid >= 0 and $j < 60
325 0 0 0 $self->{'sockets'}{$key}[4] == 0 and $self->{'sockets'}{$key}[3] == 0
0 0 0 $self->{'sockets'}{$key}[4] == 0 and $self->{'sockets'}{$key}[3] == 0 and $time - $self->{'sockets'}{$key}[2] > $self->{'timeout'}
0 0 0 $self->{'sockets'}{$key}[4] == 0 and $self->{'sockets'}{$key}[3] > 0
0 0 0 $self->{'sockets'}{$key}[4] == 0 and $self->{'sockets'}{$key}[3] > 0 and $time - $self->{'sockets'}{$key}[2] > $self->{'keepalive_timeout'}
359 281261 0 0 not defined $ret and $! == 4 || $! == 11 || $! == 11
366 0 0 281261 defined $buf and length $buf == 0
400 0 0 0 $fd < 0 and $! == 4 || $! == 11 || $! == 11
456 32 243 160 $self->{'workers'}{$wid}{'running'} and $self->{'workers'}{$wid}{'running'} == $exit_pid
533 252 0 35 $self->{'term_received'} and not $next_conn
535 178 74 0 $next_conn and $next_conn->{'buf'}
551 126 0 74 $next_conn and fileno $next_conn->{'fh'} == $try_read_fd
564 103 75 74 $conn and $next_conn
178 74 0 $conn and $next_conn and $conn != $next_conn
568 149 103 0 not $conn and $next_conn
606 149 0 0 not defined $ret and $! == 11 || $! == 11 || $! == 4
0 95 54 defined $ret and $ret == 0
641 0 92 0 defined $pipelined_buf and length $pipelined_buf
648 0 18 74 $conn->{'reqs'} < $max_readahead_reqs and $proc_req_count <= $max_reqs_per_child
680 18 0 0 not defined $ret and $! != 11
18 0 0 not defined $ret and $! != 11 and $! != 11
0 0 0 not defined $ret and $! != 11 and $! != 11 and $! != 4
704 0 35 0 $! != 4 and $! != 11
35 0 0 $! != 4 and $! != 11 and $! != 11
35 0 0 $! != 4 and $! != 11 and $! != 11 and $! != 29
71 35 0 not $peer and ($! != 4 and $! != 11 and $! != 11 and $! != 29)
732 0 3 0 $! != 4 and $! != 11
3 0 0 $! != 4 and $! != 11 and $! != 11
3 0 0 $! != 4 and $! != 11 and $! != 11 and $! != 29
4 3 0 $fd < 0 and ($! != 4 and $! != 11 and $! != 11 and $! != 29)
805 1 35 57 $use_keepalive and $reqs <= 1
917 0 0 0 $$use_keepalive_r and lc $v ne "keep-alive"
935 0 0 0 not Plack::Util::status_with_no_entity_body($status_code) and defined(my $cl = Plack::Util::content_length($body))
965 2 5 86 defined $body and ref $body eq "ARRAY"
7 1 85 defined $body and ref $body eq "ARRAY" and @$body == 1
6 2 83 defined $body and ref $body eq "ARRAY" and @$body == 1 and length $body->[0] < 8192
980 10 0 0 $have_sendfile and not $use_chunked
10 0 0 $have_sendfile and not $use_chunked and defined $body
0 0 0 $have_sendfile and not $use_chunked and defined $body and ref $body ne "ARRAY"
0 0 0 $have_sendfile and not $use_chunked and defined $body and ref $body ne "ARRAY" and fileno $body
986 0 0 0 $^O eq "linux" and not $self->{'use_unix_domain'}
994 0 0 0 $use_cork and $$use_keepalive_r
0 0 0 $use_cork and $$use_keepalive_r and not $self->{'use_unix_domain'}
1027 4 2 2 $use_chunked and not $completed
1065 10 0 111 $is_write and $is_write == 1
10 0 0 $is_write and $is_write == 2
1071 0 0 0 defined $ret and $ret == 0
0 0 0 defined $ret and $ret == 0 and $! == 11
1076 2 3 0 not defined $ret and $! == 4 || $! == 11 || $! == 11

or 2 conditions

line l !l condition
32 0 88 $ENV{'MONOCEROS_DEBUG'} || 0
71 83 0 eval { do { POSIX::sysconf(4) - 1 } } || 1023
101 47 36 $args{'host'} || 0
83 0 $args{'port'} || 8080
0 83 $args{'timeout'} || 300
0 83 $args{'keepalive_timeout'} || 10
0 64 $args{'max_reqs_per_child'} || $args{'max_requests'} || 1000
596 149 0 $self->{'port'} || 0
115 34 $self->{'host'} || 0
149 0 $conn->{'peerport'} || 0

or 3 conditions

line l !l&&r !l&&!r condition
101 0 83 0 $args{'max_keepalive_connection'} || int $open_max / 2
0 83 0 $args{'server_software'} || $class
22 61 0 $args{'server_ready'} || sub { }
131 0 83 0 $self->{'listen_sock'} ||= "IO::Socket::INET"->new("Listen", 4096, "LocalPort", $self->{'port'}, "LocalAddr", $self->{'host'}, "Proto", "tcp", "ReuseAddr", 1)
220 0 0 0 $! == 11 or $! == 11
0 0 0 $! == 11 or $! == 11 or $! == 4
229 0 0 0 $self->{'fdsend_worker'} ||= &AE::io($self->{'fdpass_sock'}[0], 1, sub { while (my $sockid = shift @{$$self{"fdsend_queue"};}) { do { unless (exists $self->{'sockets'}{$sockid}) { next; } ; if (_getpeername($self->{'sockets'}{$sockid}[1], my $addr) < 0) { delete $self->{'sockets'}{$sockid}; next; } ; my $ret = IO::FDPass::send(fileno $self->{'fdpass_sock'}[0], $self->{'sockets'}{$sockid}[1]); unless ($ret) { if ($! == 11 or $! == 11 or $! == 4) { unshift @{$$self{"fdsend_queue"};}, $sockid; return; } ; die "unable to pass queue: $!"; undef $self->{'fdsend_worker'}; } }; } ; undef $self->{'fdsend_worker'}; } )
359 0 0 0 $! == 4 || $! == 11 || $! == 11
400 0 0 0 $! == 4 || $! == 11 || $! == 11
531 74 67 169 $next_conn or $self->{'stop_accept'}
67 146 23 $next_conn or $self->{'stop_accept'} or $proc_req_count < $max_reqs_per_child
550 0 200 247 not defined $rfd or vec $rfd, $try_read_fd, 1
606 0 0 0 $! == 11 || $! == 11 || $! == 4
619 0 0 95 $self->{'term_received'} or $self->{'stop_accept'}
935 0 0 0 defined $send_headers{'content-length'} or defined $send_headers{'transfer-encoding'}
951 4 0 89 defined $send_headers{'content-length'} or defined $send_headers{'transfer-encoding'}
983 0 0 0 $send_headers{'content-length'} || -s $body
1060 111 6 1 $is_write or delete $self->{'_is_deferred_accept'}
1076 3 0 0 $! == 4 || $! == 11 || $! == 11