line |
true |
false |
branch |
84
|
0 |
0 |
@_ ? : |
105
|
0 |
0 |
$@ ? : |
120
|
0 |
0 |
unless defined(my $line = timeout(sub {
$conn->getline;
}
)) |
121
|
0 |
0 |
if (not defined $request_line) { } |
|
0 |
0 |
elsif (not defined $headers_done) { } |
122
|
0 |
0 |
if $line eq "\r\n" |
124
|
0 |
0 |
unless defined $request->{'method'} |
129
|
0 |
0 |
if ($line =~ /^\r\n/) { } |
133
|
0 |
0 |
if ($name =~ /\r\n/) |
137
|
0 |
0 |
if lc $name eq 'host' and $request->{'version'} eq 'HTTP/1.1' and $request->{'uri'} =~ s[^https?://(.+?)/][/] |
138
|
0 |
0 |
if (exists $request->{'headers'}{lc $name}) { } |
139
|
0 |
0 |
if (ref $request->{'headers'}{lc $name}) { } |
149
|
0 |
0 |
if (defined $headers_done) |
150
|
0 |
0 |
if defined $chunked |
152
|
0 |
0 |
if $request->{'version'} eq 'HTTP/1.1' and !exists $request->{'headers'}{'host'} || ref $request->{'headers'}{'host'} |
154
|
0 |
0 |
if ($_ eq 'expect' and lc $request->{'headers'}{$_} eq '100-continue' and $request->{'version'} eq 'HTTP/1.1') { } |
|
0 |
0 |
elsif ($_ eq 'content-length') { } |
|
0 |
0 |
elsif ($_ eq 'transfer-encoding' and lc $request->{'headers'}{$_} eq 'chunked') { } |
164
|
0 |
0 |
if $length |
171
|
0 |
0 |
if defined $headers_done |
179
|
0 |
0 |
defined $request->{'method'} && $request->{'method'} eq 'HEAD' ? : |
180
|
0 |
0 |
if (defined $request->{'method'} and exists $$route{$request->{'method'}}) |
182
|
0 |
0 |
if ($$route{$request->{'method'}}[$i] eq $request->{'path'} || ref $$route{$request->{'method'}}[$i] eq 'Regexp' and $request->{'path'} =~ /$$route{$request->{'method'}}[$i]/) |
199
|
0 |
0 |
lc($request->{'headers'}{'connection'} // 'close') eq 'keep-alive' ? : |
|
0 |
0 |
($request->{'version'} // '') eq 'HTTP/1.1' ? : |
202
|
0 |
0 |
if (defined $response->{'body'} and not ref $response->{'body'}) |
206
|
0 |
0 |
if $head // 0 |
207
|
0 |
0 |
if $connection eq 'close' or $connection eq 'keep-alive' and $request->{'version'} ne 'HTTP/1.1' |
210
|
0 |
0 |
if exists $hook->{'response_handler'} |
214
|
0 |
0 |
unless $conn->connected |
219
|
0 |
0 |
if defined $response->{'body'} |
220
|
0 |
0 |
if $connection eq 'close' |
224
|
0 |
0 |
if (defined wantarray) { } |
225
|
0 |
0 |
wantarray ? : |
228
|
0 |
0 |
if @_ |
233
|
0 |
0 |
if (not defined wantarray) { } |
238
|
0 |
0 |
if (ref $response->{'headers'}{$key}) { } |
257
|
0 |
0 |
if ref $_[0] eq 'HASH' |
258
|
0 |
0 |
if exists $hook->{'request_handler'} |
259
|
0 |
0 |
unless my $sock = 'IO::Socket::INET'->new('Listen', 128, 'ReuseAddr', 1, 'LocalAddr', 'localhost', 'LocalPort', 8080, 'Proto', 'tcp', @_) |
265
|
0 |
0 |
unless defined(my $pid = fork) |
267
|
0 |
0 |
if ($conn = $sock->accept) |
271
|
0 |
0 |
if $conn->connected |
273
|
0 |
0 |
if ($@) |
274
|
0 |
0 |
$config->{'debug'} // 0 ? : |
286
|
0 |
0 |
$shutdown ? : |
287
|
0 |
0 |
$closed ? : |