Skip to content

Commit 1a00554

Browse files
committed
fix datatype mismatches
1 parent 3066851 commit 1a00554

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ext/standard/php_fopen_wrapper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count)
8282

8383
if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) {
8484
/* read requested data from SAPI */
85-
int read_bytes = sapi_read_post_block(buf, count);
85+
size_t read_bytes = sapi_read_post_block(buf, count);
8686

8787
if (read_bytes > 0) {
8888
php_stream_seek(input->body, 0, SEEK_END);

main/SAPI.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ static void sapi_read_post_data(void)
243243
}
244244
}
245245

246-
SAPI_API int sapi_read_post_block(char *buffer, size_t buflen)
246+
SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen)
247247
{
248-
int read_bytes;
248+
size_t read_bytes;
249249

250250
if (!sapi_module.read_post) {
251-
return -1;
251+
return 0;
252252
}
253253

254-
read_bytes = (int)sapi_module.read_post(buffer, buflen);
254+
read_bytes = sapi_module.read_post(buffer, buflen);
255255

256256
if (read_bytes > 0) {
257257
/* gogo */
@@ -277,7 +277,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
277277
SG(request_info).request_body = php_stream_temp_create_ex(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE, PG(upload_tmp_dir));
278278

279279
if (sapi_module.read_post) {
280-
int read_bytes;
280+
size_t read_bytes;
281281

282282
for (;;) {
283283
char buffer[SAPI_POST_BLOCK_SIZE];
@@ -509,7 +509,7 @@ SAPI_API void sapi_deactivate(void)
509509
if (!SG(post_read)) {
510510
/* make sure we've consumed all request input data */
511511
char dummy[SAPI_POST_BLOCK_SIZE];
512-
int read_bytes;
512+
size_t read_bytes;
513513

514514
do {
515515
read_bytes = sapi_read_post_block(dummy, SAPI_POST_BLOCK_SIZE);

main/SAPI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ SAPI_API int sapi_add_header_ex(char *header_line, size_t header_line_len, zend_
192192
SAPI_API int sapi_send_headers(void);
193193
SAPI_API void sapi_free_header(sapi_header_struct *sapi_header);
194194
SAPI_API void sapi_handle_post(void *arg);
195-
SAPI_API int sapi_read_post_block(char *buffer, size_t buflen);
195+
SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen);
196196
SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry);
197197
SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry);
198198
SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry);

0 commit comments

Comments
 (0)