provider_proxy management added
[brisk.git] / web / Obj / sac-a-push.phh
index 91012a8..fdf5541 100644 (file)
@@ -156,6 +156,8 @@ function spu_process_info($stream_info, &$method, &$header, &$get, &$post, &$coo
                 printf("A COUNT: [%s] %d\n", $a[0], count($a));
                 for ($i = 0 ; $i < count($a) ; $i++) {
                     $b = explode('=', $a[$i]);
+                    if ($b[0] == "")
+                        continue;
                     $get[$b[0]] = urldecode($b[1]);
                 }
             }
@@ -603,7 +605,7 @@ class Sac_a_push {
         foreach ($this->socks as $k => $sock) {
             $id = intval($sock);
             if (isset($this->s2u[$id])) {
-                if ($this->s2u[$id]->sess == '') {
+                if ($this->s2u[$id]->the_end) {
                     if ($this->s2u[$id]->rd_socket_get() != NULL) {
                         $this->s2u[$id]->rd_socket_set(NULL);
                     }
@@ -614,13 +616,15 @@ class Sac_a_push {
                 }
             }
         }
+        $this->app->users_cleanup();
     }
 
     function run()
     {
         GLOBAL $DOCUMENT_ROOT, $HTTP_HOST;
 
-        GLOBAL $G_alarm_passwd, $G_ban_list, $G_black_list, $G_btrace_pref_sub, $G_dbauth;
+        GLOBAL $G_alarm_passwd, $G_ban_list, $G_black_list, $G_provider_proxy;
+        GLOBAL $G_btrace_pref_sub, $G_dbauth;
         GLOBAL $G_dbpfx, $G_donors_all, $G_donors_cur, $G_is_local, $G_lang;
         GLOBAL $G_poll_entries, $G_poll_name, $G_poll_title, $G_proxy_white_list;
         GLOBAL $G_room_roadmap, $G_shutdown;
@@ -796,7 +800,8 @@ class Sac_a_push {
                                 $line = trim($buf);
                                 if ($line == "reload") {
                                     require("$DOCUMENT_ROOT/Etc/".BRISK_CONF);
-                                    $this->app->reload($G_ban_list, $G_black_list);
+                                    $this->app->reload(FALSE, $G_ban_list, $G_black_list,
+                                                       $G_provider_proxy);
                                     global_dump();
                                 }
                                 else if ($line == "shutdown" || $line == "sd") {
@@ -848,6 +853,7 @@ class Sac_a_push {
                         if ($rret == FALSE) {
                             // FIXME: manage 404 !!!
                             printf("TODO: fix unknown page\n");
+                            fclose($new_socket);
                         }
                     }
                 }
@@ -941,6 +947,9 @@ class Sac_a_push {
                 }  // if (isset($this->s2u[$id]...
             }  // foreach ($this->socks...
             printf("\n");
+            if (defined('CURL_DE_SAC_VERS')) {
+                $this->app->cds->process();
+            }
         }  // while (...
     }  // function run(...