+foreach (array('isstream', 'f_test', 'f_trans', 'f_port', 'f_fback', 'sess', 'stat',
+ 'subst', 'step', 'from', 'transp') as $i) {
+ if (isset($_REQUEST[$i])) {
+ $$i = $_REQUEST[$i];
+ }
+}
+
+$desc = array( "Semplice: da 1 a 9 ogni secondo, poi ricomincia (status sempre verde).",
+ "Continuo: da 1 a N ogni secondo, ricomincia ogni 9 (status sempre verde).",
+ "Restart: da 1 a 8 ogni secondo, pausa 16 secondi (status passa ad arancione e poi a rosso), poi ricomincia (e status torna a verde).",
+ "Pausa: da 1 a 5 ogni secondo, pausa 3 secondi, e poi 8 e 9 ogni secondo, e poi ricomincia (status sempre verde).",
+ "Keyword: da 1 a 5 ogni secondo, @BEGIN@, @END@, @BEGIN@ xxx yyy @END@, 9, (status sempre verde).",
+ "Reload limiter: da 1 a 8 ogni secondo e chiude, 9 setta e chiude subito,<br>il client aspetta 3 secondi, e poi da 10 a N ogni secondo, (status sempre verde).",
+ "Esegue un comando, manda loc_new a un valore irraggiungibile, stoppa il processore di comandi e poi dà un comando teoricamente irraggiungibile.");
+
+
+// trim(mb_convert_case($split[0], MB_CASE_TITLE, 'UTF-8'))
+
+function headers_render($header, $len)
+{
+ $cookies = "";
+
+ if (isset($header['Cookies'])) {
+ $cookies = $header['Cookies']->render();
+ unset($header['Cookies']);
+ }
+ if (isset($header['Location'])) {
+ header(sprintf("HTTP/1.1 302 OK\r\n%sLocation: %s", $cookies, $header['Location']));
+ }
+ else if (isset($header['HTTP-Response'])) {
+ header(sprintf("HTTP/1.1 %s", $header['HTTP-Response']));
+ foreach($header as $key => $value) {
+ if (strtolower($key) == "http-response")
+ continue;
+ header(sprintf("%s: %s", $key, $value));
+ }
+ if ($len >= 0) {
+ header(sprintf("Content-Length: %ld", $len));
+ }
+ }
+ else {
+ header("HTTP/1.1 200 OK\r\n");