]> granicus.if.org Git - php/commitdiff
I am sorry I tried fixing PHP without extensive discussion on the mailing list.
authorAndrei Zmievski <andrei@php.net>
Thu, 18 Mar 2010 22:37:25 +0000 (22:37 +0000)
committerAndrei Zmievski <andrei@php.net>
Thu, 18 Mar 2010 22:37:25 +0000 (22:37 +0000)
I am sorry I tried fixing PHP without extensive discussion on the mailing list.
I am sorry I tried fixing PHP without extensive discussion on the mailing list.

Hope all the relevant parties are satisfied.

configure.in
ext/standard/file.c
main/SAPI.c
main/SAPI.h
main/rfc1867.c

index b910fcb22ba4f3b58ccd1851b2585d4977f1ed5a..fc8e88c6959ebb339b08a82e5eaaf04c5af8c4c7 100644 (file)
@@ -916,12 +916,6 @@ else
   AC_MSG_RESULT([using system default])
 fi
 
-PHP_ARG_ENABLE(large-uploads-fix, whether to enable large files (2G-4G) uploads fix,
-[  --enable-large-uploads-fix Enable large files (2G-4G) uploads fix], no, no)
-if test "$PHP_LARGE_UPLOADS_FIX" = "yes"; then
-       AC_DEFINE(HAVE_LARGE_UPLOADS_FIX, 1, [Whether to enable large files (2G-4G) uploads fix])
-fi
-
 divert(5)
 
 dnl ## In diversion 5 we check which extensions should be compiled.
index 7776f72318c0b39d97ff22c79b3bbd2a115d32a0..704ef1231fb7e7e16f48012a6e2dab3383c8386a 100644 (file)
@@ -584,8 +584,7 @@ PHP_FUNCTION(file_put_contents)
        char *filename;
        int filename_len;
        zval *data;
-       size_t numbytes = 0;
-       int result = SUCCESS;
+       int numbytes = 0;
        long flags = 0;
        zval *zcontext = NULL;
        php_stream_context *context = NULL;
@@ -635,7 +634,7 @@ PHP_FUNCTION(file_put_contents)
                case IS_RESOURCE: {
                        size_t len;
                        if (php_stream_copy_to_stream_ex(srcstream, stream, PHP_STREAM_COPY_ALL, &len) != SUCCESS) {
-                               result = FAILURE;
+                               numbytes = -1;
                        } else {
                                numbytes = len;
                        }
@@ -653,7 +652,7 @@ PHP_FUNCTION(file_put_contents)
                                numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data));
                                if (numbytes != Z_STRLEN_P(data)) {
                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
-                                       result = FAILURE;
+                                       numbytes = -1;
                                }
                        }
                        break;
@@ -679,7 +678,7 @@ PHP_FUNCTION(file_put_contents)
                                                        } else {
                                                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", bytes_written, Z_STRLEN_PP(tmp));
                                                        }
-                                                       result = FAILURE;
+                                                       numbytes = -1;
                                                        break;
                                                }
                                        }
@@ -696,19 +695,19 @@ PHP_FUNCTION(file_put_contents)
                                        numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRLEN(out));
                                        if (numbytes != Z_STRLEN(out)) {
                                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out));
-                                               result = FAILURE;
+                                               numbytes = -1;
                                        }
                                        zval_dtor(&out);
                                        break;
                                }
                        }
                default:
-                       result = FAILURE;
+                       numbytes = -1;
                        break;
        }
        php_stream_close(stream);
 
-       if (result == FAILURE) {
+       if (numbytes < 0) {
                RETURN_FALSE;
        }
 
index 14a352357b82d51a5dfcf7d8dc99c19d36fb498b..3e8abb270672b5c0a83b9e5fd8565d1db7832c84 100644 (file)
@@ -191,8 +191,8 @@ static void sapi_read_post_data(TSRMLS_D)
 
 SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
 {
-       size_t read_bytes;
-       size_t allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
+       int read_bytes;
+       int 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",
index 1ce01c47620e0e8c80cf6610fe2c934f373002e5..972a6b0e05603e731734c4c04b3e56760634a3f6 100644 (file)
@@ -120,11 +120,7 @@ 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;
index a28da1baf8514419d110f412d1f7ae54ead4b5ef..9823c759cc0ae15683e3907c462a077df520cbce 100644 (file)
@@ -764,9 +764,8 @@ 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, 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;
+       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;
        zval *http_post_files = NULL;
        HashTable *uploaded_files = NULL;
 #if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)