CHERTS

sqstat-1.2-squid-3.5.patch

Nov 16th, 2015
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.36 KB | None | 0 0
  1. --- sqstat.class.php.orig       2015-11-16 16:57:30.986990250 +0500
  2. +++ sqstat.class.php    2015-11-16 17:01:28.956936237 +0500
  3. @@ -104,7 +104,7 @@
  4.                 }
  5.                 fclose($this->fp);
  6.  
  7. -               if($raw[0]!="HTTP/1.0 200 OK"){
  8. +               if($raw[0]!="HTTP/1.1 200 OK"){
  9.                         $this->errno=1;
  10.                         $this->errstr="Cannot get data. Server answered: $raw[0]";
  11.                         return false;
  12. @@ -128,8 +128,8 @@
  13.                                 if($connection){
  14.                                         /* username field is avaible in Squid 2.6 stable */
  15.                                         if(substr($v,0,9)=="username ") $parsed["con"][$connection]["username"]=substr($v,9);
  16. -                                       if(substr($v,0,5)=="peer:") $parsed["con"][$connection]["peer"]=substr($v,6);
  17. -                                       if(substr($v,0,3)=="me:") $parsed["con"][$connection]["me"]=substr($v,4);
  18. +                                       if(substr($v,0,7)=="remote:") $parsed["con"][$connection]["remote"]=substr($v,8);
  19. +                                       if(substr($v,0,6)=="local:") $parsed["con"][$connection]["local"]=substr($v,7);
  20.                                         if(substr($v,0,4)=="uri ") $parsed["con"][$connection]["uri"]=substr($v,4);
  21.                                         if(substr($v,0,10)=="delay_pool") $parsed["con"][$connection]["delay_pool"]=substr($v,11);
  22.  
  23. @@ -175,7 +175,7 @@
  24.  
  25.                 foreach($data["con"] as $key => $v){
  26.                         if(substr($v["uri"],0,13)=="cache_object:") continue; // skip myself
  27. -                       $ip=substr($v["peer"],0,strpos($v["peer"],":"));
  28. +                       $ip=substr($v["remote"],0,strpos($v["remote"],":"));
  29.                         if(isset($hosts_array[$ip])){
  30.                                 $ip=$hosts_array[$ip];
  31.                         }
  32. @@ -186,7 +186,7 @@
  33.                                 else $ip=$hostname;
  34.                         }
  35.                         else{
  36. -                               $ip=ip2long(substr($v["peer"],0,strpos($v["peer"],":")));
  37. +                               $ip=ip2long(substr($v["remote"],0,strpos($v["remote"],":")));
  38.                         }
  39.                         $v['connection'] = $key;
  40.                         if(!isset($v["username"])) $v["username"]="N/A";
Advertisement
Add Comment
Please, Sign In to add comment