4 * brisk - spush/brisk-spush.php
6 * Copyright (C) 2012 Matteo Nastasi
7 * mailto: nastasi@alternativeoutput.it
8 * matteo.nastasi@milug.org
9 * web: http://www.alternativeoutput.it
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details. You should have received a
20 * copy of the GNU General Public License along with this program; if
21 * not, write to the Free Software Foundation, Inc, 59 Temple Place -
22 * Suite 330, Boston, MA 02111-1307, USA.
26 * - pari + 72 non fa 4x ma attualmente fa 3x, da correggere
27 * - parametrization of $DOCUMENT_ROOT var in brisk-spush.phh file
28 * - parametrization of SITE_PREFIX(_LEN) define
29 * - move the name of the named socket into the configuration file
30 * DISABLED_TO_FIX - DNS access (perform blocking dns requests, must be fixed)
32 * TEST - database connection fails after a while, check close and try PGSQL_CONNECT_FORCE_NEW.
33 * TEST - images flickering on slow windows: try to poll stream every 300 ms
35 * - configuration file management
36 * - centralize all '<script ...' incapsulation to allow multiple transport system.
38 * - manage and test cross forwarder between table and room
39 * - log_legal address fix
40 * - setcookie (for tables only and persist prefs)
41 * - 404 wrong page management
43 * TEST - unneeded garbage_time.expired access
44 * TEST - BUG: fast loop on stream index_rd_ifra page (js watchdog start without timeout corrupt counts)
45 * TEST - BUG: lurker are logged out (and remain a pending socket opened (look the spush log)
46 * TEST - BUG: logout failed (fixed with a garbage_collector wrapper at sac-a-push level
47 * TEST - garbage management
49 * DONE/FROZEN - problema con getpeer (HOSTADDR)
51 * DONE - app level keep-alive
52 * DONE - index_wr other issues
53 * DONE - from room to table
54 * DONE - from table to room
56 * DONE - bug: read from a not resource handle (already closed because a new socket substitute it)
57 * DONE - partial write for normal page management
58 * DONE - index_rd_ifra: last_clean issue
59 * DONE - fwrite failed error management (select, buffer where store unsent data, and fwrite check and retry)
60 * DONE - bug: after restart index_rd.php receive from prev clients a lot of req
61 * DONE - index_wr.php::chat
62 * DONE - index_wr.php::exit
63 * DONE - index_rd.php porting
64 * DONE - generic var management from internet
65 * DONE - index.php auth part
66 * ABRT - index_wr.php::reload - reload is js-only function
67 * ABRT - keepalive management - not interesting for our purposes
72 require_once($G_base."Obj/sac-a-push.phh");
73 require_once("./brisk-spush.phh");
74 require_once($G_base."Obj/user.phh");
75 require_once($G_base."Obj/brisk.phh");
76 require_once($G_base."Obj/auth.phh");
77 require_once($G_base."Obj/zlibstream.phh");
78 // require_once("../Obj/proxyscan.phh");
79 require_once($G_base."index.php");
80 require_once($G_base."index_wr.php");
81 require_once($G_base."briskin5/Obj/briskin5.phh");
82 require_once($G_base."briskin5/index.php");
83 require_once($G_base."briskin5/index_wr.php");
88 if (($room = Room::create()) == FALSE) {
89 log_crit("room::create failed");
93 if (($s_a_p = Sac_a_push::create($room, "/tmp/brisk.sock", 0, 0)) === FALSE) {