X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fsac-a-push.phh;h=c9220a1f13ff9f5cb47594e6bf6dbef8fdbee542;hb=7bb29caf1761665d81089090d1df1153b5d2bab9;hp=4a325dad4ebc01b8671594ab49c76d7fe2e09dfe;hpb=8ef84c5d0813096c4cc6cd05e3f213118ba8a33b;p=brisk.git diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index 4a325da..c9220a1 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -105,9 +105,13 @@ function gpcs_var($name, $get, $post, $cookie) function headers_render($header, $len) { - $s = ""; - $s .= "HTTP/1.1 200 OK\r\n"; + if (isset($header['Location'])) { + return sprintf("HTTP/1.1 302 OK\r\nLocation: %s\r\n\r\n", $header['Location']); + } + else { + $s .= "HTTP/1.1 200 OK\r\n"; + } if (!isset($header['Date'])) $s .= sprintf("Date: %s\r\n", date(DATE_RFC822)); if (!isset($header['Connection'])) @@ -284,7 +288,7 @@ class Sac_a_push { } $write = NULL; $except = NULL; - $num_changed_sockets = stream_select($read, $write, $except, 0, 250000); + $num_changed_sockets = stream_select($read, $write, $except, 5, 0); if ($num_changed_sockets == 0) { printf(" no data in 5 secs "); @@ -399,6 +403,12 @@ class Sac_a_push { } } + /* + $response: raw stream data not sent + $content: html consistent data (