- WS + CS + sync

This commit is contained in:
Jani Taskinen 2009-08-20 12:17:32 +00:00
parent e0349c5cb5
commit f6dcba571e

View File

@ -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;