--- /dev/null
+#!/bin/bash
+URL=http://dodo.birds.lan/brisk/index.php
+N=10000
+
+# TODO parameters
+
+declare -a cpid
+
+for i in $(seq 1 $N); do
+ curl -s -o /tmp/out.$i.$$.txt "$URL" &
+ cpid[$i]=$!
+done
+
+wait ${pi[*]}
+ret=$?
+
+for i in $(seq 1 $N); do
+# ls -l /tmp/out.$i.$$.txt
+ rm -f /tmp/out.$i.$$.txt
+done
+
+exit $ret
\ No newline at end of file
function run()
{
+ GLOBAL $DOCUMENT_ROOT, $HTTP_HOST, $G_with_splash;
+
if ($this->main_loop) {
return (FALSE);
}
$num_changed_sockets = stream_select($read, $write, $except, 0, 500000);
if ($num_changed_sockets == 0) {
- printf(" no data in 5 secs ");
+ printf(" no data in 5 secs, splash [%d]\n", $G_with_splash);
}
else if ($num_changed_sockets > 0) {
printf("num sock %d num_of_socket: %d\n", $num_changed_sockets, count($read));
print_r($post);
printf("COOKIE:\n");
print_r($cookie);
-
$addr = stream_socket_get_name($new_socket, TRUE);
$header_out = array();
}
else {
$buf = fread($sock, 512);
+ // if socket is closed
if ($buf == FALSE || strlen($buf) == 0) {
if ($buf == FALSE) {
printf("ERROR READING\n");
}
else if ($sock === $this->in) {
printf("Arrivati %d bytes da stdin\n", strlen($buf));
+ $line = trim($buf);
+ if ($line == "reload") {
+ require("$DOCUMENT_ROOT/Etc/".BRISK_CONF);
+ }
}
else {
$key = array_search("$sock", $this->socks);
* TEST - database connection fails after a while, check close and try PGSQL_CONNECT_FORCE_NEW.
* TEST - images flickering on slow windows: try to poll stream every 300 ms
*
- * - configuration file management
* - centralize all '<script ...' incapsulation to allow multiple transport system.
*
- * - manage and test cross forwarder between table and room
+ * - WIP (half tested) manage and test cross forwarder between table and room
* - log_legal address fix
* - setcookie (for tables only and persist prefs)
* - 404 wrong page management
*
* DONE/FROZEN - problema con getpeer (HOSTADDR)
*
+ * DONE - configuration file management
* DONE - app level keep-alive
* DONE - index_wr other issues
* DONE - from room to table