From: Matteo Nastasi (mop) Date: Sun, 7 Oct 2012 09:03:09 +0000 (+0200) Subject: sac-a-push: auto-logout cleanup of sockets array fixed X-Git-Tag: v4.0.0~39 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=33e39c735545e6f855eac0ec8c57c407f7918ae1;p=brisk.git sac-a-push: auto-logout cleanup of sockets array fixed --- diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index fd0368b..a06ef40 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -262,6 +262,23 @@ class Sac_a_push { array_push($this->pages_flush, $pgflush); } + function garbage_manager($force) + { + $this->app->garbage_manager($force); + + foreach ($this->socks as $k => $sock) { + if ($this->s2u[intval($sock)]->sess == '') { + if ($this->s2u[intval($sock)]->rd_socket_get() != NULL) { + $this->s2u[intval($sock)]->rd_socket_set(NULL); + } + unset($this->socks[intval($sock)]); + unset($this->s2u[intval($sock)]); + fclose($sock); + printf("CLOSE ON GARBAGE MANAGER\n"); + } + } + } + function run() { if ($this->main_loop) { @@ -391,10 +408,8 @@ class Sac_a_push { } } } - - - $this->app->garbage_manager(FALSE); + $this->garbage_manager(FALSE); /* manage unfinished pages */ foreach ($this->pages_flush as $k => $pgflush) {