--- cvsroot/Coro/myhttpd/httpd.pl 2001/08/25 15:14:03 1.29 +++ cvsroot/Coro/myhttpd/httpd.pl 2001/08/26 14:55:46 1.30 @@ -190,40 +190,6 @@ die bless {}, err::; } -sub err_blocked { - my $self = shift; - my $ip = $self->{remote_addr}; - my $time = time2str $blocked{$ip} = $::NOW + $::BLOCKTIME; - - Coro::Event::do_timer(after => 20*rand); - - $self->err(401, "too many connections", - { - "Content-Type" => "text/html", - "Retry-After" => $::BLOCKTIME, - "Warning" => "Please do NOT retry, you have been blocked", - "WWW-Authenticate" => "Basic realm=\"Please do NOT retry, you have been blocked\"", - "Connection" => "close", - }, - < - -Too many connections - - - -

You have been blocked because you opened too many connections. You -may retry at

- -

$time.

- -

Until then, each new access will renew the block. You might want to have a -look at the FAQ.

- - -EOF -} - sub handle { my $self = shift; my $fh = $self->{fh}; @@ -469,22 +435,10 @@ satisfiable: # check for segmented downloads if ($l && $::NO_SEGMENTED) { - my $delay = 60; + my $delay = 180; while (%{$uri{$self->{remote_addr}}{$self->{uri}}} > 1) { if ($delay <= 0) { - $self->err(400, "segmented downloads are not allowed", - { "Content-Type" => "text/html", Connection => "close" }, < - -Segmented downloads are not allowed - - - -

Segmented downloads are not allowed on this server. Please refer to the -FAQ.

- - -EOF + $self->err_segmented_download; } else { Coro::Event::do_timer(after => 3); $delay -= 3; }