X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fspush%2Fbrisk-spush.phh;h=4728b923af5932608b242c38063814e023ccec6e;hb=9b4ce3e614e0636bc76fee81d5c1ec41ae5bd742;hp=f0bcfcbf7ce4feef3bc234c004e0e5456eec3992;hpb=8a1c0c18404ef3191b775fceef5ca03d1a237393;p=brisk.git diff --git a/web/spush/brisk-spush.phh b/web/spush/brisk-spush.phh index f0bcfcb..4728b92 100644 --- a/web/spush/brisk-spush.phh +++ b/web/spush/brisk-spush.phh @@ -32,17 +32,20 @@ class PageFlush { var $msg; // place where store failed fwrite data var $msg_sz; // size of content - function PageFlush($socket, $curtime, $kalive, $header_out, $body) + function PageFlush($socket, $enc, $curtime, $kalive, $header_out, $body) { printf("TRY FLUSH CREATE\n"); - // $body_sz = mb_strlen($body, "ASCII"); - // add length to header_out - $hea = headers_render($header_out, 0); + $body_out = ZLibStream::compress($enc, $body); + if ($enc != 'plain') + $header_out['Content-Encoding'] = $enc; + $body_out_sz = mb_strlen($body_out, "ASCII"); + $hea = headers_render($header_out, $body_out_sz); + $hea_sz = mb_strlen($hea, "ASCII"); $this->socket = $socket; $this->kalive = $curtime + $kalive; - $this->msg = $hea.$body; - $this->msg_sz = mb_strlen($this->msg, "ASCII"); + $this->msg = $hea.$body_out; + $this->msg_sz = $hea_sz + $body_out_sz; } /* return TRUE if is removable from it's list */