if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) {
/* read requested data from SAPI */
- int read_bytes = sapi_read_post_block(buf, count);
+ size_t read_bytes = sapi_read_post_block(buf, count);
if (read_bytes > 0) {
php_stream_seek(input->body, 0, SEEK_END);
}
}
-SAPI_API int sapi_read_post_block(char *buffer, size_t buflen)
+SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen)
{
- int read_bytes;
+ size_t read_bytes;
if (!sapi_module.read_post) {
- return -1;
+ return 0;
}
- read_bytes = (int)sapi_module.read_post(buffer, buflen);
+ read_bytes = sapi_module.read_post(buffer, buflen);
if (read_bytes > 0) {
/* gogo */
SG(request_info).request_body = php_stream_temp_create_ex(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE, PG(upload_tmp_dir));
if (sapi_module.read_post) {
- int read_bytes;
+ size_t read_bytes;
for (;;) {
char buffer[SAPI_POST_BLOCK_SIZE];
if (!SG(post_read)) {
/* make sure we've consumed all request input data */
char dummy[SAPI_POST_BLOCK_SIZE];
- int read_bytes;
+ size_t read_bytes;
do {
read_bytes = sapi_read_post_block(dummy, SAPI_POST_BLOCK_SIZE);
SAPI_API int sapi_send_headers(void);
SAPI_API void sapi_free_header(sapi_header_struct *sapi_header);
SAPI_API void sapi_handle_post(void *arg);
-SAPI_API int sapi_read_post_block(char *buffer, size_t buflen);
+SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen);
SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry);
SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry);
SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry);