summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2013-08-05 12:02:10 +0200
committerMichael Wallner <mike@php.net>2013-08-05 12:02:10 +0200
commit69aed1b61fd87633a4decc75e190abc24848172a (patch)
tree92b93b656c743c6cdee7830eebad2b0533f1c523
parent7ca7ea85cd5db249be6348ab10914c39bcae6c69 (diff)
parentd80a91018dc0d7b771cf8517f788a408f3a4f473 (diff)
downloadphp-git-69aed1b61fd87633a4decc75e190abc24848172a.tar.gz
Merge branch 'master' of github.com:/ralflang/php-src
merged pull request #372: >2G uploads by Ralf Lang https://github.com/php/php-src/pull/372
-rw-r--r--main/SAPI.h5
-rw-r--r--main/rfc1867.c11
-rw-r--r--sapi/cgi/cgi_main.c2
3 files changed, 12 insertions, 6 deletions
diff --git a/main/SAPI.h b/main/SAPI.h
index 92b7329dbc..6fc60c8865 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -27,6 +27,7 @@
#include "zend_operators.h"
#ifdef PHP_WIN32
#include "win95nt.h"
+#include "win32/php_stdint.h"
#endif
#include <sys/stat.h>
@@ -82,7 +83,7 @@ typedef struct {
char *post_data, *raw_post_data;
char *cookie_data;
long content_length;
- uint post_data_length, raw_post_data_length;
+ int64_t post_data_length, raw_post_data_length;
char *path_translated;
char *request_uri;
@@ -119,7 +120,7 @@ typedef struct _sapi_globals_struct {
void *server_context;
sapi_request_info request_info;
sapi_headers_struct sapi_headers;
- int read_post_bytes;
+ int64_t read_post_bytes;
unsigned char headers_sent;
struct stat global_stat;
char *default_mimetype;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index ed7ce9c0c1..3c160702ae 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -34,6 +34,10 @@
#include "rfc1867.h"
#include "ext/standard/php_string.h"
+#if defined(PHP_WIN32) && !defined(HAVE_ATOLL)
+# define atoll(s) _atoi64(s)
+#endif
+
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
static int dummy_encoding_translation(TSRMLS_D)
@@ -676,8 +680,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;
+ int64_t total_bytes = 0, max_file_size = 0;
+ int skip_upload = 0, anonindex = 0, is_anonymous;
zval *http_post_files = NULL;
HashTable *uploaded_files = NULL;
multipart_buffer *mbuff;
@@ -898,7 +903,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
if (!strcasecmp(param, "MAX_FILE_SIZE")) {
- max_file_size = atol(value);
+ max_file_size = atoll(value);
}
efree(param);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 4c78fcafec..221b002175 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -508,7 +508,7 @@ static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
uint read_bytes = 0;
int tmp_read_bytes;
- count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes));
+ count_bytes = MIN(count_bytes, SG(request_info).content_length - SG(read_post_bytes));
while (read_bytes < count_bytes) {
tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_bytes);
if (tmp_read_bytes <= 0) {