… | |
… | |
151 | ([^\040]+) \040+ |
151 | ([^\040]+) \040+ |
152 | HTTP\/([0-9]+\.[0-9]+) |
152 | HTTP\/([0-9]+\.[0-9]+) |
153 | \015\012/gx |
153 | \015\012/gx |
154 | or $self->err(403, "method not allowed", { Allow => "GET,HEAD" }); |
154 | or $self->err(403, "method not allowed", { Allow => "GET,HEAD" }); |
155 | |
155 | |
156 | $2 ne "1.0" |
156 | $2 >= 2 |
157 | or $self->err(506, "http protocol version not supported"); |
157 | or $self->err(506, "http protocol version not supported"); |
158 | |
158 | |
159 | $self->{method} = $1; |
159 | $self->{method} = $1; |
160 | $self->{uri} = $2; |
160 | $self->{uri} = $2; |
161 | |
161 | |
… | |
… | |
344 | |
344 | |
345 | $self->print_response(@code, $hdr, ""); |
345 | $self->print_response(@code, $hdr, ""); |
346 | |
346 | |
347 | if ($self->{method} eq "GET") { |
347 | if ($self->{method} eq "GET") { |
348 | my ($fh, $buf); |
348 | my ($fh, $buf); |
349 | open $fh, "<", $self->{path} |
349 | cpen $fh, "<", $self->{path} |
350 | or die "$self->{path}: late open failure ($!)"; |
350 | or die "$self->{path}: late open failure ($!)"; |
351 | |
351 | |
352 | if ($l) { |
352 | if ($l) { |
353 | sysseek $fh, $l, 0 |
353 | sysseek $fh, $l, 0 |
354 | or die "$self->{path}: cannot seek to $l ($!)"; |
354 | or die "$self->{path}: cannot seek to $l ($!)"; |