]> granicus.if.org Git - php/commitdiff
fix datatype mismatches
authorAnatol Belski <ab@php.net>
Tue, 24 Mar 2015 20:15:15 +0000 (21:15 +0100)
committerAnatol Belski <ab@php.net>
Tue, 24 Mar 2015 21:02:31 +0000 (22:02 +0100)
ext/standard/php_fopen_wrapper.c
main/SAPI.c
main/SAPI.h

index 1dc6a21cf549829db92dffa08480fb3f56ec73c0..f004c943b5e1a523540de1b828ce1b2550e0d41d 100644 (file)
@@ -82,7 +82,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count)
 
        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);
index 2757c2e5218fcdcb9d8b5cb1fc3df1125e1f993c..f14638a22f1dc39a165be4ede5188eef2c601c94 100644 (file)
@@ -243,15 +243,15 @@ static void sapi_read_post_data(void)
        }
 }
 
-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 */
@@ -277,7 +277,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
        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];
@@ -509,7 +509,7 @@ SAPI_API void sapi_deactivate(void)
                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);
index e7a2721641b6f24c939278c86ad14078b8faf7c8..67ee50dec28381307ed82a7afd06400d3f200d2f 100644 (file)
@@ -192,7 +192,7 @@ SAPI_API int sapi_add_header_ex(char *header_line, size_t header_line_len, zend_
 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);