diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-05-13 15:24:40 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-05-13 15:24:40 +0400 |
| commit | 7fcd4064c01d607958456f2771b12a8ade508208 (patch) | |
| tree | 117339ca1ee4b3c26a7ccf141570721ecdef603e /ext/standard/php_fopen_wrapper.c | |
| parent | b8b8c497c4b9d6deceee0b287fd7630f79f7f4ea (diff) | |
| parent | c7abe84d945c8e5cc805ced0868bf37f6b656b2a (diff) | |
| download | php-git-7fcd4064c01d607958456f2771b12a8ade508208.tar.gz | |
Merge branch 'master' into phpng
* master: (41 commits)
fix test - output can be chunked
fix test
fix test
Fixed test for commit 997be125eb0228c5b1b6dd278f617791e71192c6
Add bug fix to NEWS
Update UPGRADING according to bug fix
fix test
improve CURL tests to allow testing without separate server
improve CURL tests to allow testing without separate server
Fixed bug #67199 mb_regex_encoding mishmash
Fix bug #67248 (imageaffinematrixget missing check of parameters)
Fix bug #67247 spl_fixedarray_resize integer overflow
fix news
add tests stuff to README
Updated NEWS
Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions...
- Fixed off-by-one in phar_build (patch by crrodriguez at opensuse dot org)
- Move checking
- Fixed missing NULL check in SimpleXMLElement::xpath()
- Fixed missing NULL check
...
Conflicts:
ext/bz2/bz2.c
ext/gd/gd.c
ext/mbstring/php_mbregex.c
ext/session/tests/031.phpt
ext/simplexml/simplexml.c
ext/spl/spl_fixedarray.c
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
| -rw-r--r-- | ext/standard/php_fopen_wrapper.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 3deb330a8f..7e21e95d18 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -64,7 +64,7 @@ php_stream_ops php_stream_output_ops = { }; typedef struct php_stream_input { /* {{{ */ - php_stream **body_ptr; + php_stream *body; off_t position; } php_stream_input_t; /* }}} */ @@ -85,13 +85,13 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); if (read_bytes > 0) { - php_stream_seek(*input->body_ptr, 0, SEEK_END); - php_stream_write(*input->body_ptr, buf, read_bytes); + php_stream_seek(input->body, 0, SEEK_END); + php_stream_write(input->body, buf, read_bytes); } } - php_stream_seek(*input->body_ptr, input->position, SEEK_SET); - read = php_stream_read(*input->body_ptr, buf, count); + php_stream_seek(input->body, input->position, SEEK_SET); + read = php_stream_read(input->body, buf, count); if (!read || read == (size_t) -1) { stream->eof = 1; @@ -122,9 +122,9 @@ static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, o { php_stream_input_t *input = stream->abstract; - if (*input->body_ptr) { - int sought = php_stream_seek(*input->body_ptr, offset, whence); - *newoffset = (*input->body_ptr)->position; + if (input->body) { + int sought = php_stream_seek(input->body, offset, whence); + *newoffset = (input->body)->position; return sought; } @@ -228,10 +228,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } input = ecalloc(1, sizeof(*input)); - if (*(input->body_ptr = &SG(request_info).request_body)) { - php_stream_rewind(*input->body_ptr); + if ((input->body = SG(request_info).request_body)) { + php_stream_rewind(input->body); } else { - *input->body_ptr = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); + input->body = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); + SG(request_info).request_body = input->body; } return php_stream_alloc(&php_stream_input_ops, input, 0, "rb"); |
