From: Matteo Nastasi (mop) Date: Thu, 8 Nov 2012 08:05:38 +0000 (+0100) Subject: Merge branch 'sac-a-push' of mop.mine.nu:brisk into sac-a-push X-Git-Tag: v4.0.0~8 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=7e49e6384494f47d12ba4f1a69fb9dd2c1b77e1c;hp=0111ff7f7bd3e29e582bb4b4c761e5c10873220a;p=brisk.git Merge branch 'sac-a-push' of mop.mine.nu:brisk into sac-a-push --- diff --git a/test/curlbust.sh b/test/curlbust.sh new file mode 100755 index 0000000..f675814 --- /dev/null +++ b/test/curlbust.sh @@ -0,0 +1,22 @@ +#!/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 diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index c5faa55..527d9b7 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -311,6 +311,8 @@ class Sac_a_push { function run() { + GLOBAL $DOCUMENT_ROOT, $HTTP_HOST, $G_with_splash; + if ($this->main_loop) { return (FALSE); } @@ -338,7 +340,7 @@ class Sac_a_push { $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)); @@ -377,7 +379,6 @@ class Sac_a_push { print_r($post); printf("COOKIE:\n"); print_r($cookie); - $addr = stream_socket_get_name($new_socket, TRUE); $header_out = array(); @@ -401,6 +402,7 @@ class Sac_a_push { } else { $buf = fread($sock, 512); + // if socket is closed if ($buf == FALSE || strlen($buf) == 0) { if ($buf == FALSE) { printf("ERROR READING\n"); @@ -438,6 +440,10 @@ class Sac_a_push { } 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); diff --git a/web/spush/brisk-spush.php b/web/spush/brisk-spush.php index 075fabd..bb0cf4e 100755 --- a/web/spush/brisk-spush.php +++ b/web/spush/brisk-spush.php @@ -32,10 +32,9 @@ * 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 '