ID: 48725
Updated by: [email protected]
Reported By: slusarz at curecanti dot org
Status: Open
Bug Type: Streams related
Operating System: Linux
PHP Version: 5.2.10
New Comment:
It's related, not same. :)
Previous Comments:
------------------------------------------------------------------------
[2009-10-22 21:40:37] slusarz at curecanti dot org
I don't think this is related to bug #49816. Turning off zlib output
compression (by adding "ini_set('zlib.output_compression', 'Off');" to
the top of the test script)doesn't alter the results from the test
script previously reported.
------------------------------------------------------------------------
[2009-10-19 15:15:51] [email protected]
See also bug #49816
------------------------------------------------------------------------
[2009-07-14 03:10:46] slusarz at curecanti dot org
<?php
// 16,000 bytes
$text = str_repeat('0123456789abcdef', 1000);
$temp = fopen('php://temp', 'r+');
stream_filter_append($temp, 'zlib.deflate', STREAM_FILTER_WRITE);
fwrite($temp, $text);
rewind($temp);
fpassthru($temp);
print "Location: " . ftell($temp) . "\n";
fclose($temp);
// Expected: compressed data; Location = some non-zero integer
// Actual: No data output; Location = 0
------------------------------------------------------------------------
[2009-06-29 20:03:00] slusarz at curecanti dot org
Description:
------------
There does not seem to be any support for flushing data in a zlib
compression stream. Not sure if this is an omission, something obvious
that I am missing (and may not be in the documentation), or the fact
that the zlib stream filter does not support socket operation.
Reproduce code:
---------------
$stream = stream_socket_client([...]);
// Login to remote server & enable compression remotely (e.g.
implementation of IMAP COMPRESS extension - RFC 4978)
stream_filter_append($stream, 'zlib.deflate', STREAM_FILTER_WRITE);
stream_set_write_buffer($stream, 0);
fwrite($stream, 'Testing');
fflush($stream);
// tcpdump confirms that nothing is sent from the PHP server to the
remote server. Can confirm that upon socket timeout, the pending data
is sent.
// Similarly, compressed data from incoming stream is not available
either.
stream_filter_append($stream, 'zlib.inflate', STREAM_FILTER_READ);
$in = fread($stream, 8192);
// fread() on $stream will timeout.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48725&edit=1