… | |
… | |
271 | |
271 | |
272 | $self->{server_port} = $self->{h}{host} =~ s/:([0-9]+)$// ? $1 : 80; |
272 | $self->{server_port} = $self->{h}{host} =~ s/:([0-9]+)$// ? $1 : 80; |
273 | |
273 | |
274 | weaken ($uri{$self->{remote_addr}}{$self->{uri}}{$self*1} = $self); |
274 | weaken ($uri{$self->{remote_addr}}{$self->{uri}}{$self*1} = $self); |
275 | |
275 | |
|
|
276 | eval { |
276 | $self->map_uri; |
277 | $self->map_uri; |
277 | $self->respond; |
278 | $self->respond; |
|
|
279 | }; |
|
|
280 | |
|
|
281 | die if $@ && !ref $@; |
278 | |
282 | |
279 | $self->eoconn; |
283 | $self->eoconn; |
280 | |
284 | |
281 | last if $self->{h}{connection} =~ /close/ || $self->{version} lt "1.1"; |
285 | last if $self->{h}{connection} =~ /close/ || $self->{version} lt "1.1"; |
282 | |
286 | |
… | |
… | |
429 | goto ignore; |
433 | goto ignore; |
430 | } |
434 | } |
431 | goto satisfiable if $l >= 0 && $l < $length && $h >= 0 && $h > $l; |
435 | goto satisfiable if $l >= 0 && $l < $length && $h >= 0 && $h > $l; |
432 | } |
436 | } |
433 | $hdr->{"Content-Range"} = "bytes */$length"; |
437 | $hdr->{"Content-Range"} = "bytes */$length"; |
|
|
438 | $hdr->{"Content-Length"} = $length; |
434 | $self->slog(9, "not satisfiable($self->{h}{range}|".$self->{h}{"user-agent"}.")"); |
439 | $self->slog(9, "not satisfiable($self->{h}{range}|".$self->{h}{"user-agent"}.")"); |
435 | $self->err(416, "not satisfiable", $hdr); |
440 | $self->err(416, "not satisfiable", $hdr, ""); |
436 | |
441 | |
437 | satisfiable: |
442 | satisfiable: |
438 | # check for segmented downloads |
443 | # check for segmented downloads |
439 | if ($l && $::NO_SEGMENTED) { |
444 | if ($l && $::NO_SEGMENTED) { |
440 | if (%{$uri{$self->{remote_addr}}{$self->{uri}}} > 1) { |
445 | if (%{$uri{$self->{remote_addr}}{$self->{uri}}} > 1) { |