#48307 [Csd]: stream_copy_to_stream() and sockets
| From: | lbarnaud@php.net | Date: | Sat, 16 May 2009 20:24:50 +0000 |
| Subject: | #48307 [Csd]: stream_copy_to_stream() and sockets | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137408@lists.php.net to get a copy of this message | ||
ID: 48307
Updated by: lbarnaud@php.net
Reported By: lbarnaud@php.net
Status: Closed
Bug Type: Streams related
PHP Version: 5
Assigned To: lbarnaud
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-05-16 20:19:15] lbarnaud@php.net
Description:
------------
stream_copy_to_stream() copies 0 bytes when $source is a socket
Reproduce code:
---------------
$sockets = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, 0);
fwrite($sockets[0], b"a");
stream_socket_shutdown($sockets[0], STREAM_SHUT_WR);
var_dump(stream_copy_to_stream($sockets[1], STDOUT));
Expected result:
----------------
int(1)
a
Actual result:
--------------
int(0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48307&edit=1