mirror of
https://github.com/php/php-src.git
synced 2024-09-29 13:56:09 +00:00
- WS + CS + sync
This commit is contained in:
parent
e0349c5cb5
commit
f6dcba571e
@ -74,20 +74,20 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
|
||||
off_t *position = (off_t*)stream->abstract;
|
||||
size_t read_bytes = 0;
|
||||
|
||||
if(!stream->eof) {
|
||||
if(SG(request_info).raw_post_data) { /* data has already been read by a post handler */
|
||||
if (!stream->eof) {
|
||||
if (SG(request_info).raw_post_data) { /* data has already been read by a post handler */
|
||||
read_bytes = SG(request_info).raw_post_data_length - *position;
|
||||
if(read_bytes <= count) {
|
||||
if (read_bytes <= count) {
|
||||
stream->eof = 1;
|
||||
} else {
|
||||
read_bytes = count;
|
||||
}
|
||||
if(read_bytes) {
|
||||
if (read_bytes) {
|
||||
memcpy(buf, SG(request_info).raw_post_data + *position, read_bytes);
|
||||
}
|
||||
} else if(sapi_module.read_post) {
|
||||
} else if (sapi_module.read_post) {
|
||||
read_bytes = sapi_module.read_post(buf, count TSRMLS_CC);
|
||||
if(read_bytes <= 0){
|
||||
if (read_bytes <= 0) {
|
||||
stream->eof = 1;
|
||||
read_bytes = 0;
|
||||
}
|
||||
@ -98,7 +98,8 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
|
||||
|
||||
*position += read_bytes;
|
||||
SG(read_post_bytes) += read_bytes;
|
||||
return read_bytes;
|
||||
|
||||
return read_bytes;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@ -293,7 +294,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
|
||||
efree(pathdup);
|
||||
|
||||
return stream;
|
||||
} else {
|
||||
} else {
|
||||
/* invalid php://thingy */
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid php:// URL specified");
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user