|
@@ -145,7 +145,7 @@ if ($errors=='' && $_GET['acctock']!='' && $_GET['host']!='') {
|
|
$res=@file_get_contents('https://'.$url,false,$context);
|
|
$res=@file_get_contents('https://'.$url,false,$context);
|
|
//echo preprint($http_response_header);
|
|
//echo preprint($http_response_header);
|
|
if (isset($http_response_header))
|
|
if (isset($http_response_header))
|
|
- $rl=ckratelimit($http_response_header,'echofun',true,false);
|
|
|
|
|
|
+ $rl=ckratelimit($http_response_header);
|
|
if ($res!==false && is_array($http_response_header) && gethttpcode($http_response_header)=='200' && null!==$res=@json_decode($res,true)) {
|
|
if ($res!==false && is_array($http_response_header) && gethttpcode($http_response_header)=='200' && null!==$res=@json_decode($res,true)) {
|
|
foreach ($res as $val) {
|
|
foreach ($res as $val) {
|
|
if (isset($val['domain'],$val['severity']) && $val['domain']==$acchost) {
|
|
if (isset($val['domain'],$val['severity']) && $val['domain']==$acchost) {
|
|
@@ -173,7 +173,7 @@ if ($errors=='' && $_GET['acctock']!='' && $_GET['host']!='') {
|
|
//echo preprint($http_response_header);
|
|
//echo preprint($http_response_header);
|
|
if (isset($http_response_header)) {
|
|
if (isset($http_response_header)) {
|
|
$httpcode=gethttpcode($http_response_header);
|
|
$httpcode=gethttpcode($http_response_header);
|
|
- $rl=ckratelimit($http_response_header,'echofun',true,false);
|
|
|
|
|
|
+ $rl=ckratelimit($http_response_header);
|
|
}
|
|
}
|
|
if ($res===false) {
|
|
if ($res===false) {
|
|
echo "<div class=\"error\">Error: could not connect to «{$hhost}».</div>\n";
|
|
echo "<div class=\"error\">Error: could not connect to «{$hhost}».</div>\n";
|
|
@@ -196,7 +196,7 @@ if ($errors=='' && $_GET['acctock']!='' && $_GET['host']!='') {
|
|
$out.=" suspended by «{$hhost}».<br>\n<br>\n{$acchostck}</div>\n";
|
|
$out.=" suspended by «{$hhost}».<br>\n<br>\n{$acchostck}</div>\n";
|
|
echo $out;
|
|
echo $out;
|
|
}
|
|
}
|
|
- if (is_array($rl) && @file_put_contents($rlfp,$rl['remaining']."\n".($rl['secstoreset']+time())."\n")===false)
|
|
|
|
|
|
+ if (is_array($rl) && isset($rl['ok']) && $rl['ok'] && @file_put_contents($rlfp,$rl['remaining']."\n".($rl['sleep']+time())."\n")===false)
|
|
echo "<div class=\"warning\">Warning: could not write to rate limit state file.</div>\n";
|
|
echo "<div class=\"warning\">Warning: could not write to rate limit state file.</div>\n";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -216,8 +216,4 @@ function gethttpcode($headers) {
|
|
return preg_replace('#^[^ ]+ (\d+).*$#','$1',$headers[0]);
|
|
return preg_replace('#^[^ ]+ (\d+).*$#','$1',$headers[0]);
|
|
}
|
|
}
|
|
|
|
|
|
-function echofun($msg) {
|
|
|
|
- echo $msg;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
?>
|
|
?>
|