X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fspush%2Fbrisk-spush.php;h=35c2584117470c3c490f2ca8b7d50a9826c35834;hb=5397b38d036459e80f0e5ce4c2f53bd8263007cc;hp=e7d5f85873d789299ac732bc4772755206889786;hpb=d951bcaafbc7f0f091879d6f47043492534d2d08;p=brisk.git diff --git a/web/spush/brisk-spush.php b/web/spush/brisk-spush.php index e7d5f85..35c2584 100755 --- a/web/spush/brisk-spush.php +++ b/web/spush/brisk-spush.php @@ -39,21 +39,27 @@ require_once($G_base."briskin5/index.php"); require_once($G_base."briskin5/index_wr.php"); -function main() +function main($argv) { - if (($room = Room::create()) == FALSE) { - log_crit("room::create failed"); - exit(1); - } + pid_save(); + do { + if (($room = Room::create(LEGAL_PATH."/brisk-crystal.data")) == FALSE) { + log_crit("room::create failed"); + $ret = 1; + break; + } - if (($s_a_p = Sac_a_push::create($room, "/tmp/brisk.sock", 0, 0)) === FALSE) { - exit(1); - } + if (($s_a_p = Sac_a_push::create($room, USOCK_PATH, 0, 0, $argv)) === FALSE) { + $ret = 2; + break; + } - $s_a_p->run(); + $ret = $s_a_p->run(); + } while (0); - exit(0); + pid_remove(); + exit($ret); } -main(); +main($argv); ?>