$content = "";
$user->stream_init($s_a_p->rndstr, $enc, $header_out, $content, $get, $post, $cookie);
- $response = headers_render($header_out, -1).chunked_content($user->rd_zls_get(), $content);
+ $response = headers_render($header_out, -1).$user->chunked_content($content);
$response_l = mb_strlen($response, "ASCII");
$wret = @fwrite($new_socket, $response, $response_l);
* MAIN
*/
-function chunked_content($zls, $content)
-{
- if ($zls) {
- $cont_comp = $zls->compress_chunk($content);
- }
- else {
- $cont_comp = $content;
- }
- $cont_comp_l = mb_strlen($cont_comp, "ASCII");
- // printf("CHUNK: [%s]\n", $content);
-
- return (sprintf("%X\r\n", $cont_comp_l).$cont_comp."\r\n");
-}
-
-function chunked_fini()
-{
- return sprintf("0\r\n");
-}
-
function get_encoding($header)
{
$enc = "plain";
$content = $user->stream_keepalive(FALSE);
}
if ($content != "") {
- $response = chunked_content($user->rd_zls_get(), $content);
+ $response = $user->chunked_content($content);
}
}
function chunk($step, $cont)
{
}
+
+ function is_chunked()
+ {
+ }
}
class Transport_xhr {
{
return ("@BEGIN@".$cont."@END@");
}
+
+ function is_chunked()
+ {
+ return TRUE;
+ }
}
class Transport_iframe {
push(\"%s\");\n// -->\n</script>", $step, escpush($cont) );
}
}
+
+ function is_chunked()
+ {
+ return TRUE;
+ }
}
class Transport_htmlfile extends Transport_iframe {
var $rd_cache; // place where store failed fwrite data
var $rd_zls; // zlibstream object handle if compressed stream, else FALSE
var $rd_transp; // class that define stream encapsulation type (iframe, xhr, ...)
+ var $rd_is_chunked; // is the transport chunked or not ?
var $comm; // commands array
// var $asta_card; //
$thiz->rd_cache = "";
$thiz->rd_zls = FALSE;
$thiz->rd_transp = NULL;
+ $thiz->rd_is_chunked = FALSE;
$thiz->asta_card = -2;
$thiz->asta_pnt = -1;
$this->rd_kalive = $curtime + RD_KEEPALIVE_TOUT;
$this->rd_zls = ZLibStream::create($enc);
$this->rd_transp = Transport::create($transp);
+ $this->rd_is_chunked = $this->rd_transp->is_chunked();
}
function rd_socket_get() {
return (FALSE);
}
+function is_chunked()
+{
+ return $this->rd_is_chunked;
+}
+
+
+function chunked_content($content)
+{
+ if ($this->rd_zls) {
+ $cont_comp = $this->rd_zls->compress_chunk($content);
+ }
+ else {
+ $cont_comp = $content;
+ }
+ $cont_comp_l = mb_strlen($cont_comp, "ASCII");
+ // printf("CHUNK: [%s]\n", $content);
+
+ if ($this->is_chunked()) {
+ return (sprintf("%X\r\n", $cont_comp_l).$cont_comp."\r\n");
+ }
+ else {
+ return $content;
+ }
+}
+
+function chunked_fini()
+{
+ return sprintf("0\r\n");
+}
+
+
} // end class User
$content = "";
$user->stream_init($s_a_p->rndstr, $enc, $header_out, $content, $get, $post, $cookie);
- $response = headers_render($header_out, -1).chunked_content($user->rd_zls_get(), $content);
+ $response = headers_render($header_out, -1).$user->chunked_content($content);
$response_l = mb_strlen($response, "ASCII");
$wret = @fwrite($new_socket, $response, $response_l);