Branch Coverage

blib/lib/HTTP/Server/Singlethreaded.pm
Criterion Covered Total %
branch 19 122 15.5


line true false branch
4 0 1 $ENV{'OS'} =~ /win/i ? :
94 0 1 if ($@) { }
103 0 0 ref $_[0] ? :
118 0 1 if exists $args{'port'}
119 0 1 if exists $args{'timeout'}
120 0 1 if exists $args{'maxclients'}
121 0 1 if exists $args{'static'}
122 0 1 if exists $args{'function'}
123 0 1 if exists $args{'cgibin'}
124 0 1 if exists $args{'servertype'}
125 0 1 if exists $args{'webemail'}
126 0 1 if exists $args{'path'}
128 0 1 unless @HTTP::Server::Singlethreaded::Port
133 0 2 unless socket $l, 2, 1, getprotobyname 'tcp'
136 0 2 unless fcntl $l, 4, 2048
139 0 2 unless setsockopt $l, 1, 2, "\cA\000\000\000"
144 0 2 unless (bind $l, sockaddr_in($_, "\000\000\000\000"))
145 0 2 unless listen $l, 128
147 2 0 if (defined $l) { }
156 0 1 unless @Listeners
186 0 0 unless ref $HTTP::Server::Singlethreaded::Function{$_} eq 'CODE'
191 0 0 if exists $HTTP::Server::Singlethreaded::Path{$_}
195 0 0 if exists $HTTP::Server::Singlethreaded::Path{$_}
275 0 0 unless (m[^(\w+) (\S+) HTTP/(\S+)\s*(.*)$HTTP::Server::Singlethreaded::CRLF$HTTP::Server::Singlethreaded::CRLF]s)
303 0 0 if (uc $_{'REQUEST_METHOD'} eq 'POST')
313 0 0 if (exists $HTTP::Server::Singlethreaded::Path{$mypath})
318 0 0 if (ref $HTTP::Server::Singlethreaded::Path{$mypath})
323 0 0 unless $@
334 0 0 if ($HTTP::Server::Singlethreaded::Path{$mypath} =~ /^STATIC (.+)/)
342 0 0 unless (open $FILE, '<', $filename)
363 0 0 if ($read < $size)
389 0 0 if (length $URIpath[$#URIpath] > 0) { }
425 0 0 unless $dispatchretval
437 0 0 if @_
439 0 0 if length $_{'Data'}
440 0 0 if (ref $dispatchretval) { }
461 0 0 if ($continue[$_])
475 0 0 if ($Accepting)
493 0 0 if (length $outbuf[$fn])
501 0 0 unless $nfound > 0
504 0 0 if ($Accepting)
507 0 0 unless vec $rout, fileno $_, 1
565 0 0 unless defined $fn and vec $wout, $fn, 1
568 0 0 if (defined $wlen) { }
572 0 0 if (length $outbuf[$fn] < $HTTP::Server::Singlethreaded::StaticBufferSize)
576 0 0 if (defined $LargeFile[$fn]) { }
0 0 elsif ($continue[$fn]) { }
584 0 0 if ($read) { }
587 0 0 unless defined $read
597 0 0 unless length $outbuf[$fn]
607 0 0 unless length $outbuf[$fn]
613 0 0 unless defined($fn = fileno $_)
614 0 0 if (vec $rout, $fn, 1)
618 0 0 if (length $char) { }
622 0 0 if ($inbuf[$fn] =~ /^POST .*?Content-Length: ?(\d+)[\015\012]+(.*)$/is) { }
0 0 elsif (substr($inbuf[$fn], -4, 4) eq "\r\n\r\n") { }
625 0 0 if (length $2 >= $1) { }
644 0 0 unless close $_
649 0 0 if (vec $eout, $fn, 1)
653 0 0 unless close $_
671 0 0 if $Services