ID: 48725
User updated by: slusarz at curecanti dot org
Reported By: slusarz at curecanti dot org
-Status: No Feedback
+Status: Open
Bug Type: Streams related
Operating System: Linux
PHP Version: 5.2.10
New Comment:
<?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
Previous Comments:
------------------------------------------------------------------------
[2009-07-07 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-06-29 20:39:18] [email protected]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[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