Browse Source

fix datatype mismatches

pull/1198/head
Anatol Belski 11 years ago
parent
commit
1a00554aaf
  1. 2
      ext/standard/php_fopen_wrapper.c
  2. 12
      main/SAPI.c
  3. 2
      main/SAPI.h

2
ext/standard/php_fopen_wrapper.c

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

12
main/SAPI.c

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

2
main/SAPI.h

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

Loading…
Cancel
Save