diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-11-15 23:44:14 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-11-15 23:44:14 +0000 |
commit | 67dcd65a5734f50ec638718c8a01d4927b54aa25 (patch) | |
tree | 1fd155ef45bec863aff262037a911008b11b05c0 /main/php_streams.h | |
parent | 00fa3587ba72cfa5b30ad99bfa694be524ca8742 (diff) | |
download | php-git-67dcd65a5734f50ec638718c8a01d4927b54aa25.tar.gz |
MFH: Fixed bug #29801 (Set limit on the size of mmapable data).
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-x | main/php_streams.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/php_streams.h b/main/php_streams.h index 000b4291c3..d6499ce896 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -410,8 +410,11 @@ END_EXTERN_C() #define PHP_STREAM_OPTION_RETURN_NOTIMPL -2 /* underlying stream does not implement; streams can handle it instead */ /* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, copy until eof(src). - * Uses mmap if the src is a plain file and at offset 0 */ -#define PHP_STREAM_COPY_ALL -1 + * Uses mmap if the src is a plain file and at offset 0 + * To ensure we don't take up too much memory when reading large files, set the default mmap length + * at this many bytes */ +#define PHP_STREAM_COPY_ALL 2000000 + BEGIN_EXTERN_C() PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC); #define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC TSRMLS_CC) |