diff options
author | Anatol Belski <ab@php.net> | 2014-05-07 15:00:18 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-05-07 15:00:18 +0200 |
commit | ede2963963ba8ef88f9ab4df7e7ba0f26413d2bc (patch) | |
tree | 0994768125745549ea95939071eda2434e0faa66 /ext/standard/php_fopen_wrapper.c | |
parent | bc92917e7325cea46f2f563933957b72efc1cf61 (diff) | |
parent | f63ca453e0b8b31fb2dd029327d5435e9650aa4d (diff) | |
download | php-git-ede2963963ba8ef88f9ab4df7e7ba0f26413d2bc.tar.gz |
Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
Fixed test (it requires ext/hash)
Fixed tests (they might fail from time to time because of session GC)
NEWS
XFAIL-- for bug #67198
remove useless indirection
fix bug #67198 (php://input regression)
rename a constant - old name to new name
test for bug #67198
Fix author name on the #63228 patch.
Conflicts:
ext/standard/php_fopen_wrapper.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 583ccdc232..9d6b4eafe7 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; zend_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, zend_off_t offset, int when { 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"); |