Bug #50787 [ReO->Csd]: stream_set_write_buffer() has no effect on socket streams
| From: | cataphract@php.net | Date: | Sat, 19 Feb 2011 01:43:58 +0000 |
| Subject: | Bug #50787 [ReO->Csd]: stream_set_write_buffer() has no effect on socket streams | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158884@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50787&edit=1
ID: 50787
Updated by: cataphract@php.net
Reported by: vnegrier at optilian dot com
Summary: stream_set_write_buffer() has no effect on socket
streams
-Status: Re-Opened
+Status: Closed
Type: Bug
Package: Streams related
Operating System: linux
PHP Version: 5.3.1
Assigned To: cataphract
Block user comment: N
Private report: N
New Comment:
Fixed in trunk by reverting the patch attached to this bug report and
adding a stream_set_chunk_size function, PHP 5.3 is unaffected.
http://svn.php.net/viewvc?view=revision&revision=308477
Previous Comments:
------------------------------------------------------------------------
[2011-02-16 18:43:35] cataphract@php.net
Just a few more comments:
Strangely, PHP_STREAM_OPTION_WRITE_BUFFER also controls the flag
PHP_STREAM_FLAG_NO_BUFFER, which is used only for reading (controls
whether to keep a PHP read buffer or not), which is also a target of
PHP_STREAM_OPTION_READ_BUFFER. So there's already some mixing of read
and write semantics in PHP_STREAM_OPTION_WRITE_BUFFER.
In any case, I still think this should be revisited.
------------------------------------------------------------------------
[2011-02-16 18:33:46] cataphract@php.net
I'm reopening this because the fix makes the meaning of
PHP_STREAM_OPTION_WRITE_BUFFER ambiguous.
For the plain wrapper it's used as a wrapper for setvbuf and the only
values it accepts are 0, 1 and 2, for _IOFBF, _IOLBF and _IONBF.
For the socket stream, it's being used as a synonymous of
PHP_STREAM_OPTION_SET_CHUNK_SIZE. This makes no sense, especially since
the chunk size is also used for read buffering.
I understand the problem, but this can't be the solution; I'm reverting
this patch since setvbuf is specific to the stdio, but not without a
solution first -- perhaps a new function to change the chunk size.
------------------------------------------------------------------------
[2010-02-03 20:21:40] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294453
Log: - Fixed bug #50787 (stream_set_write_buffer() has no effect on
socket streams).
------------------------------------------------------------------------
[2010-01-18 12:50:15] iliaa@php.net
This bug has been fixed in SVN.
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.
------------------------------------------------------------------------
[2010-01-18 12:50:09] svn@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=293699
Log: Fixed bug #50787 (stream_set_write_buffer() has no effect on socket
streams).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=50787
--
Edit this bug report at http://bugs.php.net/bug.php?id=50787&edit=1