Branch Coverage

blib/lib/Net/Server/PreForkSimple.pm
Criterion Covered Total %
branch 24 94 25.5


line true false branch
54 4 5 unless defined $prop->{$_} and $prop->{$_} =~ /^\d+$/
66 0 3 if ($prop->{'multi_port'} and $prop->{'serialize'} and $prop->{'serialize'} eq 'none')
70 3 0 unless ($prop->{'serialize'} and $prop->{'serialize'} =~ /^(flock|semaphore|pipe|none)$/i)
72 0 3 $^O eq 'MSWin32' ? :
76 3 0 if ($prop->{'serialize'} eq 'flock') { }
0 0 elsif ($prop->{'serialize'} eq 'semaphore') { }
0 0 elsif ($prop->{'serialize'} eq 'pipe') { }
0 0 elsif ($prop->{'serialize'} eq 'none') { }
78 0 3 if (defined $prop->{'lock_file'}) { }
84 0 3 unless close $fh
92 0 0 unless my $s = 'IPC::Semaphore'->new(IPC::SysV::IPC_PRIVATE(), 1, IPC::SysV::S_IRWXU() | IPC::SysV::IPC_CREAT())
94 0 0 unless $s->setall(1)
118 0 2 if ($ENV{'HUP_CHILDREN'})
134 0 2 if $n <= 0
145 0 3 unless defined $pid
147 2 1 if ($pid) { }
168 0 0 unless ($prop->{'connected'})
175 1 0 $prop->{'serialize'} eq 'flock' ? :
176 1 0 if ($needs_lock)
177 0 1 unless open $prop->{'lock_fh'}, '>', $prop->{'lock_file'}
190 0 1 if $self->done
195 0 0 if $needs_lock and $prop->{'lock_fh'}
213 2 0 if ($prop->{'serialize'} eq 'flock') { }
0 0 elsif ($prop->{'serialize'} eq 'semaphore') { }
0 0 elsif ($prop->{'serialize'} eq 'pipe') { }
215 0 0 if $! == 4
222 0 0 unless $prop->{'sem'}->op(0, -1, IPC::SysV::SEM_UNDO())
224 0 0 unless $prop->{'sem'}->op(0, 1, IPC::SysV::SEM_UNDO())
241 0 1 if @_
242 0 1 if $prop->{'done'}
243 0 1 if $prop->{'requests'} >= $prop->{'max_requests'}
244 0 1 if $prop->{'SigHUPed'}
245 0 1 if (not kill(0, $prop->{'ppid'}))
266 0 0 unless $chld > 0
275 0 0 if (defined(my $pid = each %{$$prop{'children'};}))
276 0 0 if not kill('HUP', $pid)
283 0 1 if ($ENV{'HUP_CHILDREN'})
285 0 0 unless $chld > 0
293 0 0 if (check_sigs())
294 0 0 if $prop->{'_HUP'}
301 0 0 if ($time - $prop->{'last_checked_for_dead'} > $prop->{'check_for_dead'})
304 0 0 unless kill 0, $_
312 0 0 if ($_->{'status'} eq 'dequeue') { }
319 0 0 if ($prop->{'max_servers'} > $total_n)
324 0 0 if (defined $prop->{'check_for_dequeue'})
325 0 0 if ($time - $prop->{'last_checked_for_dequeue'} > $prop->{'check_for_dequeue'})
328 0 0 if (defined $prop->{'max_dequeue'} and $total_d < $prop->{'max_dequeue'})