#48307 [Opn->Csd]: stream_copy_to_stream() and sockets

From: Date: Sat, 16 May 2009 20:24:11 +0000
Subject: #48307 [Opn->Csd]: stream_copy_to_stream() and sockets
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137407@lists.php.net to get a copy of this message
ID: 48307 Updated by: lbarnaud@php.net Reported By: lbarnaud@php.net -Status: Open +Status: Closed Bug Type: Streams related PHP Version: 5 Assigned To: lbarnaud 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

« previous php.bugs (#137407) next »