… | |
… | |
106 | $block->[3] = $::NOW + 10; |
106 | $block->[3] = $::NOW + 10; |
107 | |
107 | |
108 | if ($limit > $::NOW) { |
108 | if ($limit > $::NOW) { |
109 | Coro::Event::do_timer(after => $limit - $::NOW); |
109 | Coro::Event::do_timer(after => $limit - $::NOW); |
110 | |
110 | |
111 | if ($block->[2] > 30) { |
111 | if ($block->[2] > 20) { |
112 | $block->[3] = $::NOW + 180; |
112 | $block->[3] = $::NOW + $::DYNABLOCK + 360; |
113 | $status = 401; |
113 | $status = 401; |
114 | $hdr->{Warning} = "Please do NOT retry, you have been blocked. Press Cancel instead."; |
114 | $hdr->{Warning} = "Please do NOT retry, your IP has been blocked due to excessive hammering. Press Cancel instead."; |
115 | $hdr->{"WWW-Authenticate"} = "Basic realm=\"Please do NOT retry, you have been blocked. Press Cancel instead.\""; |
115 | $hdr->{"WWW-Authenticate"} = "Basic realm=\"Please do NOT retry, you IP has been blocked due to excessive hammering. Press Cancel instead.\""; |
|
|
116 | |
|
|
117 | if ($block->[2] > 40) { |
|
|
118 | system "/root/s/dynablock --add $self->{remote_ip} $::DYNABLOCK &"; |
|
|
119 | } |
116 | } |
120 | } |
117 | } |
121 | } |
118 | |
122 | |
119 | $self->err($status, $block->[1], $hdr, |
123 | $self->err($status, $block->[1], $hdr, |
120 | <<EOF); |
124 | <<EOF); |