X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2FObj%2Fbrisk.phh;h=00c32222190e8a6b723ef94b25cffd449da3bc9c;hb=c09f1a53453d47ff1f7467655e95d109ada76f02;hp=f8c922532536dc1be6c37f78fbb47125756f2491;hpb=d841ff52fc567de174bad9323d6bce06825f3762;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index f8c9225..00c3222 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -288,6 +288,18 @@ Copyright 2006-2012 Matteo Nasta
version '.$G_brisk_version.'
Copyright 2006-2012 Matteo Nastasi (aka mop)
');
+function addrtoipv4($addr)
+{
+ $ipv4addr_arr = explode(':' , $addr);
+ if (isset($ipv4addr_arr[3])) {
+ $ipv4addr = $ipv4addr_arr[3];
+ }
+ else {
+ $ipv4addr = $addr;
+ }
+ return $ipv4addr;
+}
+
function mop_flush()
{
for ($i = 0; $i < ob_get_level(); $i++)
@@ -325,42 +337,6 @@ function file_unlock($res)
}
}
-function webservers_exceeded()
-{
- return(file_exists(PROXY_PATH."/webservers_exceded.flag"));
-}
-
-function webservers_check()
-{
- GLOBAL $G_webserver_max;
-
- /* FIXME: check all procs expirations */
- return (10);
-
- $ct = 0;
-
- $dh = opendir('/proc');
- while (($file = readdir($dh)) !== false) {
- if (preg_match('/[0-9]+/', $file)) {
- $cmdline = explode("\0", file_get_contents('/proc/'.$file.'/cmdline'));
- // echo "xxx".$cmdline[0].$n;
- if (strstr('/usr/sbin/apache2', $cmdline[0]) != FALSE) {
- // echo "yyy".$cmdline[0].$n;
- $ct++;
- }
- }
- }
- closedir($dh);
-
- if ($ct >= $G_webserver_max) {
- touch(PROXY_PATH."/webservers_exceded.flag");
- }
- else {
- unlink(PROXY_PATH."/webservers_exceded.flag");
- }
- return ($ct);
-}
-
$escpush_from = array("\\", "\"");
$escpush_to = array("\\\\", "\\\"");
function escpush($s)
@@ -731,8 +707,6 @@ class Room
return ($ismod);
}
- webservers_check();
-
// Before all align times with table timeout
for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
$table_cur = $this->table[$table_idx];