… | |
… | |
91 | EOF |
91 | EOF |
92 | } |
92 | } |
93 | |
93 | |
94 | sub conn::err_blocked { |
94 | sub conn::err_blocked { |
95 | my $self = shift; |
95 | my $self = shift; |
96 | my $ip = $self->{remote_id}; |
96 | my $id = $self->{remote_id}; |
97 | my $ctime = $HTTP_NOW; |
97 | my $ctime = $HTTP_NOW; |
98 | my $etime = time2str $conn::blocked{$ip} = $::NOW + $::BLOCKTIME; |
98 | my $etime = time2str $conn::blocked{$ip} = $::NOW + $::BLOCKTIME; |
99 | |
99 | |
100 | Coro::Event::do_timer(after => 20*rand); |
100 | Coro::Event::do_timer(after => 20*rand); |
101 | |
101 | |
… | |
… | |
112 | <head> |
112 | <head> |
113 | <title>Too many connections</title> |
113 | <title>Too many connections</title> |
114 | </head> |
114 | </head> |
115 | <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000080" alink="#ff0000"> |
115 | <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000080" alink="#ff0000"> |
116 | |
116 | |
117 | <p>You have been blocked because you opened too many connections. You |
117 | <p>You have been blocked because you didn't behave. You may retry at</p> |
118 | may retry at</p> |
|
|
119 | |
118 | |
120 | <p><blockquote>$etime.</blockquote></p> |
119 | <p><blockquote>$etime.</blockquote></p> |
121 | |
120 | |
122 | <p>For your reference, the current time and your identifier is:</p> |
121 | <p>For your reference, the current time and your identifier is:</p> |
123 | |
122 | |
124 | <p><blockquote>$ctime | $id</blockquote></p> |
123 | <p><blockquote>$ctime | $id</blockquote></p> |
125 | |
124 | |
126 | <p>Until then, each new access will renew the block. You might want to have a |
125 | <p>Until then, each access will renew the block. This should give |
127 | look at the <a href="http://www.goof.com/pcg/marc/animefaq.html#blocked">FAQ</a>.</p> |
126 | you ample time to look at the <a href="http://www.goof.com/pcg/marc/animefaq.html#blocked">FAQ</a>.</p> |
128 | |
127 | |
129 | </body></html> |
128 | </body></html> |
130 | EOF |
129 | EOF |
131 | } |
130 | } |
132 | |
131 | |