php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75515 "stream_copy_to_stream" doesn't stream anymore
Submitted: 2017-11-13 09:56 UTC Modified: 2017-11-15 14:36 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nicolas dot grekas+php at gmail dot com Assigned: pollita (profile)
Status: Closed Package: Streams related
PHP Version: 7.2.0RC6 OS: Ubuntu
Private report: No CVE-ID: None
 [2017-11-13 09:56 UTC] nicolas dot grekas+php at gmail dot com
Description:
------------
See test script.

This behavior change has been introduced in PHP7.2RC6, and can be fixed by the change on 710 of main/streams/streams.c:

```
-               if (!stream->wrapper || stream->wrapper->is_url) {
+               if (stream->wrapper != &php_plain_files_wrapper) {
```



Test script:
---------------
run on the shell:

php -r 'echo "ping"; stream_copy_to_stream(STDIN, STDOUT);' 


then type something to populate stdin, and hit "enter".
On "enter", the input should be copied to the STDOUT.
But on RC6, this doesn't happen until STDIN is closed.

Expected result:
----------------
see test script

Actual result:
--------------
see test script

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-13 10:00 UTC] kelunik@php.net
-Package: Scripting Engine problem +Package: Streams related
 [2017-11-13 10:11 UTC] kelunik@php.net
-Status: Open +Status: Verified
 [2017-11-14 19:00 UTC] kelunik@php.net
@remi+sara: Why master only? Because the cherry-pick will happen later?
 [2017-11-15 10:18 UTC] kalle@php.net
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: pollita
 [2017-11-15 10:18 UTC] kalle@php.net
@Sara, this seems like it should be re-evaluated for 7.2 before GA
 [2017-11-15 14:36 UTC] remi@php.net
-Status: Assigned +Status: Closed
 [2017-11-15 14:36 UTC] remi@php.net
The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Applied in PHP-7.2.0

BTW, more feedback welcome on this one
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC