summaryrefslogtreecommitdiff
path: root/main/streams.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-09-28 22:10:47 +0000
committerWez Furlong <wez@php.net>2002-09-28 22:10:47 +0000
commit393d57d5be32b39dc84fa8159dbb52c3df5b3cee (patch)
tree199af8ff0721ea5be5a9f0cf10c10e50da6c8579 /main/streams.c
parent04bb45cf4bc9553b5976a32ca0aabecd90023496 (diff)
downloadphp-git-393d57d5be32b39dc84fa8159dbb52c3df5b3cee.tar.gz
Differentiate between write buffer and streams read buffer sizes.
Add options for timeout and chunk size; previously these were only set-able for socket streams.
Diffstat (limited to 'main/streams.c')
-rwxr-xr-xmain/streams.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/streams.c b/main/streams.c
index 68928548e4..b578ac89d1 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -799,7 +799,12 @@ PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, voi
if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) {
switch(option) {
- case PHP_STREAM_OPTION_BUFFER:
+ case PHP_STREAM_OPTION_SET_CHUNK_SIZE:
+ ret = stream->chunk_size;
+ stream->chunk_size = value;
+ return ret;
+
+ case PHP_STREAM_OPTION_READ_BUFFER:
/* try to match the buffer mode as best we can */
if (value == PHP_STREAM_BUFFER_NONE) {
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
@@ -1291,7 +1296,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
return -1; /* not yet implemented */
#endif
- case PHP_STREAM_OPTION_BUFFER:
+ case PHP_STREAM_OPTION_WRITE_BUFFER:
if (ptrparam)
size = *(size_t *)ptrparam;
else