brisk-spush TODO updated
[brisk.git] / web / spush / brisk-spush.php
1 #!/usr/bin/php
2 <?php
3 /*
4  *  brisk - spush/brisk-spush.php
5  *
6  *  Copyright (C) 2012 Matteo Nastasi
7  *                          mailto: nastasi@alternativeoutput.it 
8  *                                  matteo.nastasi@milug.org
9  *                          web: http://www.alternativeoutput.it
10  *
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.
15  *
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.
23  *
24  * TODO
25  *
26  *   - BUG: fast loop on stream index_rd_ifra page
27  *
28  *   - centralize all '<script ...' incapsulation to allow multiple transport system.
29  *
30  *   - manage and test cross forwarder between table and room
31  *   - log_legal address fix
32  *   - setcookie (for tables only and persist prefs)
33  *   - 404 wrong page management
34  *
35  *   TEST - BUG: lurker are logged out (and remain a pending socket opened (look the spush log)
36  *   TEST - BUG: logout failed (fixed with a garbage_collector wrapper at sac-a-push level
37  *   TEST - garbage management
38  *
39  *   DONE/FROZEN - problema con getpeer (HOSTADDR)
40  *
41  *   DONE - app level keep-alive
42  *   DONE - index_wr other issues
43  *   DONE - from room to table
44  *   DONE - from table to room
45  *   DONE - chunked
46  *   DONE - bug: read from a not resource handle (already closed because a new socket substitute it)
47  *   DONE - partial write for normal page management
48  *   DONE - index_rd_ifra: last_clean issue
49  *   DONE - fwrite failed error management (select, buffer where store unsent data, and fwrite check and retry)
50  *   DONE - bug: after restart index_rd.php receive from prev clients a lot of req
51  *   DONE - index_wr.php::chat
52  *   DONE - index_wr.php::exit
53  *   DONE - index_rd.php porting
54  *   DONE - generic var management from internet
55  *   DONE - index.php auth part
56  *   ABRT - index_wr.php::reload - reload is js-only function
57  *   ABRT - keepalive management - not interesting for our purposes
58  */
59
60 $G_base = "../";
61
62 require_once($G_base."Obj/sac-a-push.phh");
63 require_once("./brisk-spush.phh");
64 require_once($G_base."Obj/user.phh");
65 require_once($G_base."Obj/brisk.phh");
66 require_once($G_base."Obj/auth.phh");
67 // require_once("../Obj/proxyscan.phh");
68 require_once($G_base."index.php");
69 require_once($G_base."index_wr.php");
70 require_once($G_base."briskin5/Obj/briskin5.phh");
71 require_once($G_base."briskin5/index.php");
72 require_once($G_base."briskin5/index_wr.php");
73
74
75 function main()
76 {
77     if (($room = Room::create()) == FALSE) {
78         log_crit("room::create failed");
79         exit(1);
80     }
81
82     if (($s_a_p = Sac_a_push::create($room, "/tmp/brisk.sock", 0, 0)) === FALSE) {
83         exit(1);
84     }
85
86     $s_a_p->run();
87
88     exit(0);
89 }
90
91 main();
92 ?>