diff options
author | Zeev Suraski <zeev@php.net> | 2000-04-01 01:11:39 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-04-01 01:11:39 +0000 |
commit | 53586378b0a5aee61d88298f7f9ba822745565cb (patch) | |
tree | 3900678fd4f8a00bc493bed0c1ee128c00a15a82 /main/SAPI.c | |
parent | eb224c78504ff02ae5ff306c50e0e9736a3472aa (diff) | |
download | php-git-53586378b0a5aee61d88298f7f9ba822745565cb.tar.gz |
@- Fix a problem when dealing with large POST blocks in CGI mode
Diffstat (limited to 'main/SAPI.c')
-rw-r--r-- | main/SAPI.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index aa673429b8..ba3f1af251 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -160,27 +160,27 @@ static void sapi_read_post_data(SLS_D) SAPI_POST_READER_FUNC(sapi_read_standard_form_data) { - int read_bytes, total_read_bytes=0; + int read_bytes; int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; SG(request_info).post_data = emalloc(allocated_bytes); for (;;) { - read_bytes = sapi_module.read_post(SG(request_info).post_data+total_read_bytes, SAPI_POST_BLOCK_SIZE SLS_CC); + read_bytes = sapi_module.read_post(SG(request_info).post_data+SG(read_post_bytes), SAPI_POST_BLOCK_SIZE SLS_CC); if (read_bytes<=0) { break; } - total_read_bytes += read_bytes; + SG(read_post_bytes) += read_bytes; if (read_bytes < SAPI_POST_BLOCK_SIZE) { break; } - if (total_read_bytes+SAPI_POST_BLOCK_SIZE >= allocated_bytes) { - allocated_bytes = total_read_bytes+SAPI_POST_BLOCK_SIZE+1; + if (SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE >= allocated_bytes) { + allocated_bytes = SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE+1; SG(request_info).post_data = erealloc(SG(request_info).post_data, allocated_bytes); } } - SG(request_info).post_data[total_read_bytes] = 0; /* terminating NULL */ - SG(request_info).post_data_length = total_read_bytes; + SG(request_info).post_data[SG(read_post_bytes)] = 0; /* terminating NULL */ + SG(request_info).post_data_length = SG(read_post_bytes); } |