summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2010-03-18 21:07:38 +0000
committerAndrei Zmievski <andrei@php.net>2010-03-18 21:07:38 +0000
commit3220f15ca2859621d3cec72514bf782633d90ff0 (patch)
treecfbf835583534fabb532cf12941e44ccd8290ddd /main
parent981ba00606191c2b010ec49b7e21b8731afe86aa (diff)
downloadphp-git-3220f15ca2859621d3cec72514bf782633d90ff0.tar.gz
Fix a few problems with large (2G-4G) file uploads. Added
--enable-large-uploads-fix switch because one change was in SAPI.h structure.
Diffstat (limited to 'main')
-rw-r--r--main/SAPI.c4
-rw-r--r--main/SAPI.h4
-rw-r--r--main/rfc1867.c5
3 files changed, 9 insertions, 4 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 3e8abb2706..14a352357b 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -191,8 +191,8 @@ static void sapi_read_post_data(TSRMLS_D)
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
{
- int read_bytes;
- int allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
+ size_t read_bytes;
+ size_t allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
if (SG(request_info).content_length > SG(post_max_size)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes",
diff --git a/main/SAPI.h b/main/SAPI.h
index 972a6b0e05..1ce01c4762 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -120,7 +120,11 @@ typedef struct _sapi_globals_struct {
void *server_context;
sapi_request_info request_info;
sapi_headers_struct sapi_headers;
+#ifdef HAVE_LARGE_UPLOADS_FIX
+ size_t read_post_bytes;
+#else
int read_post_bytes;
+#endif
unsigned char headers_sent;
struct stat global_stat;
char *default_mimetype;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 9823c759cc..a28da1baf8 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -764,8 +764,9 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
{
char *boundary, *s = NULL, *boundary_end = NULL, *start_arr = NULL, *array_index = NULL;
char *temp_filename = NULL, *lbuf = NULL, *abuf = NULL;
- int boundary_len = 0, total_bytes = 0, cancel_upload = 0, is_arr_upload = 0, array_len = 0;
- int max_file_size = 0, skip_upload = 0, anonindex = 0, is_anonymous;
+ int boundary_len = 0, cancel_upload = 0, is_arr_upload = 0, array_len = 0;
+ int skip_upload = 0, anonindex = 0, is_anonymous;
+ size_t total_bytes = 0, max_file_size = 0;
zval *http_post_files = NULL;
HashTable *uploaded_files = NULL;
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)