diff options
| author | Marcus Boerger <helly@php.net> | 2007-02-03 16:40:05 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2007-02-03 16:40:05 +0000 |
| commit | 0709a0490f4ae638fbecf5c05aa80b78fc670902 (patch) | |
| tree | 9a858e5866ff868ac1f134a2c580985c33d15832 /main/streams/memory.c | |
| parent | 74cafe08403cae6c1a2a56da0b58eb88258bb861 (diff) | |
| download | php-git-0709a0490f4ae638fbecf5c05aa80b78fc670902.tar.gz | |
- MFH Add PHPAPI to stuff needed by streams API for shared exts
- MFH Readonly issue fix to memory streams option handling (still not
activated in 5.2.1 though)
Diffstat (limited to 'main/streams/memory.c')
| -rw-r--r-- | main/streams/memory.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/streams/memory.c b/main/streams/memory.c index 2b690895ec..9e906b355d 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -253,6 +253,9 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu return PHP_STREAM_OPTION_RETURN_OK; case PHP_STREAM_TRUNCATE_SET_SIZE: + if (ms->mode & TEMP_STREAM_READONLY) { + return PHP_STREAM_OPTION_RETURN_ERR; + } newsize = *(size_t*)ptrparam; if (newsize <= ms->fsize) { if (newsize < ms->fpos) { @@ -272,7 +275,7 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu } /* }}} */ -php_stream_ops php_stream_memory_ops = { +PHPAPI php_stream_ops php_stream_memory_ops = { php_stream_memory_write, php_stream_memory_read, php_stream_memory_close, php_stream_memory_flush, "MEMORY", @@ -532,7 +535,7 @@ static int php_stream_temp_set_option(php_stream *stream, int option, int value, } /* }}} */ -php_stream_ops php_stream_temp_ops = { +PHPAPI php_stream_ops php_stream_temp_ops = { php_stream_temp_write, php_stream_temp_read, php_stream_temp_close, php_stream_temp_flush, "TEMP", @@ -585,7 +588,7 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char } /* }}} */ -php_stream_ops php_stream_rfc2397_ops = { +PHPAPI php_stream_ops php_stream_rfc2397_ops = { php_stream_temp_write, php_stream_temp_read, php_stream_temp_close, php_stream_temp_flush, "RFC2397", |
