[PHP-CVS] tag php-src: create tag php-5.4.20
Tag php-5.4.20 in php-src.git was created Tag: 110d051f698c30372f50907a2e223ac67f6aa667 Tagger: Stanislav Malyshev Tue Sep 17 22:49:12 2013 -0700 Log: 5.4.20 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (Darwin) iF4EABEIAAYFAlI5PtsACgkQL3lWvF2gS11aSwD+MdfnIMOwDpNTEz1n+r08Ee00 RsKS0s7HJ4i1n/5hlIMA/A0BKihfvi+pj1gOq2Mo7/Cw8Vz4ucwGeOc9vlAL1liy =aQoM -END PGP SIGNATURE- Link: http://git.php.net/?p=php-src.git;a=tag;h=110d051f698c30372f50907a2e223ac67f6aa667 Target: fc0bb37067fab35689dbf32684e5780fcc21aed0 Author: Stanislav Malyshev Tue, 17 Sep 2013 22:48:57 -0700 Parents: 7d0eafce3a93105090662ef2e9bb4fe8995183a5 Target link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fc0bb37067fab35689dbf32684e5780fcc21aed0 Target log: 5.4.20 Changed paths: M NEWS M configure.in M main/php_version.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: 5.4.20: NEWS configure.in main/php_version.h
Commit:fc0bb37067fab35689dbf32684e5780fcc21aed0 Author:Stanislav Malyshev Tue, 17 Sep 2013 22:48:57 -0700 Parents: 7d0eafce3a93105090662ef2e9bb4fe8995183a5 Branches: PHP-5.4.20 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fc0bb37067fab35689dbf32684e5780fcc21aed0 Log: 5.4.20 Changed paths: M NEWS M configure.in M main/php_version.h Diff: diff --git a/NEWS b/NEWS index 55ab369..7d87b02 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ PHPNEWS ||| -05 Sep 2013, PHP 5.4.20 RC1 +19 Sep 2013, PHP 5.4.20 - Core: . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). diff --git a/configure.in b/configure.in index b93db4d..8b8cf03 100644 --- a/configure.in +++ b/configure.in @@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 PHP_RELEASE_VERSION=20 -PHP_EXTRA_VERSION="RC1" +PHP_EXTRA_VERSION="" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 1 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/main/php_version.h b/main/php_version.h index b53355c..9be8b3d 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 4 #define PHP_RELEASE_VERSION 20 -#define PHP_EXTRA_VERSION "RC1" -#define PHP_VERSION "5.4.20RC1" +#define PHP_EXTRA_VERSION "" +#define PHP_VERSION "5.4.20" #define PHP_VERSION_ID 50420 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /SVNROOT/ global_avail
bjoriTue, 17 Sep 2013 22:18:19 + Revision: http://svn.php.net/viewvc?view=revision&revision=331427 Log: Joe wants to improve the getting involved section Changed paths: U SVNROOT/global_avail Modified: SVNROOT/global_avail === --- SVNROOT/global_avail2013-09-17 20:01:29 UTC (rev 331426) +++ SVNROOT/global_avail2013-09-17 22:18:19 UTC (rev 331427) @@ -64,7 +64,7 @@ avail|ericstewart|web/php.git/archive avail|odoucet|web/news.git,web/qa.git avail|shein,marco|web/news.git -avail|dragoonis,seld,wojak,levim,mikemike,guilhermeblanco|web/php.git +avail|dragoonis,seld,wojak,levim,mikemike,guilhermeblanco,krakjoe|web/php.git avail|mikemike|web/people.git avail|stewartlord,danielc,googleguy|web/php.git,web/master.git -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: NEWS/UPGRADING{,.INTERNALS} notes about temp POST stream: NEWS UPGRADING UPGRADING.INTERNALS
Hi Mike, On Wed, Sep 18, 2013 at 5:16 AM, Michael Wallner wrote: > Did you try to open and use a php://input wrapper instead of using > SG(request_info).request_body directly like said in UPGRADING.INTERNALS? > > I didn't read the last and the most important paragraph :( Thank you for the tip. -- Yasuo Ohgaki yohg...@ohgaki.net
Re: [PHP-CVS] com php-src: NEWS/UPGRADING{,.INTERNALS} notes about temp POST stream: NEWS UPGRADING UPGRADING.INTERNALS
HiYasuo! On Sep 17, 2013 9:39 PM, "Yasuo Ohgaki" wrote: > > Hi Mike, > > The code looks great! > I need to get SG(request_info).post_data and SG(request_info).raw_post_data in a module at RINIT and runtime. > > I asked it internals ML. Could you give me some pointers? Did you try to open and use a php://input wrapper instead of using SG(request_info).request_body directly like said in UPGRADING.INTERNALS? Mike
Re: [PHP-CVS] com php-src: NEWS/UPGRADING{,.INTERNALS} notes about temp POST stream: NEWS UPGRADING UPGRADING.INTERNALS
Hi Mike, The code looks great! I need to get SG(request_info).post_data and SG(request_info).raw_post_data in a module at RINIT and runtime. I asked it internals ML. Could you give me some pointers? Thank you. -- Yasuo Ohgaki yohg...@ohgaki.net
[PHP-CVS] com php-src: fix build - PRIu64 vs %I64u: main/php_variables.c
Commit:4a85b5e190d6651bee26bbbeff4ed09d2932f352 Author:Anatol Belski Tue, 17 Sep 2013 16:02:08 +0200 Parents: e6084da4735c945cb071c4d9259ea0d702eb77c6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4a85b5e190d6651bee26bbbeff4ed09d2932f352 Log: fix build - PRIu64 vs %I64u Changed paths: M main/php_variables.c Diff: diff --git a/main/php_variables.c b/main/php_variables.c index af3a6aa..353aa63 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -292,7 +292,11 @@ static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof while (add_post_var(arr, vars, eof TSRMLS_CC)) { if (++vars->cnt > max_vars) { php_error_docref(NULL TSRMLS_CC, E_WARNING, +#ifdef PHP_WIN32 + "Input variables exceeded %I64u. " +#else "Input variables exceeded %" PRIu64 ". " +#endif "To increase the limit change max_input_vars in php.ini.", max_vars); return FAILURE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: revert stream cast: main/php_streams.h
Commit:e3e4d1b144a818b68e9332e75a35b2870c7253b8 Author:Michael Wallner Tue, 10 Sep 2013 13:13:09 +0200 Parents: d4b673a34c873a7d732507ce5f83385acff8a59c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e3e4d1b144a818b68e9332e75a35b2870c7253b8 Log: revert stream cast Changed paths: M main/php_streams.h Diff: diff --git a/main/php_streams.h b/main/php_streams.h index c9732b4..c56014c 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -242,7 +242,7 @@ PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, END_EXTERN_C() #define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) -#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->rsrc_id +#define php_stream_get_resource_id(stream) (stream)->rsrc_id #if ZEND_DEBUG /* use this to tell the stream that it is OK if we don't explicitly close it */ # define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: we need to use the full stream wrapper for filters: ext/standard/php_fopen_wrapper.c
Commit:0f78d8612a7b16f1bbe3fb80a99896d7163c0aa7 Author:Michael Wallner Tue, 17 Sep 2013 13:44:02 +0200 Parents: 41d78110ffd576a9afa352426ed2c15ab7308bec Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0f78d8612a7b16f1bbe3fb80a99896d7163c0aa7 Log: we need to use the full stream wrapper for filters Changed paths: M ext/standard/php_fopen_wrapper.c Diff: diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index ca0b92e..f624cf4 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -73,8 +73,8 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count { php_stream *inner = stream->abstract; - if (inner && inner->ops->read) { - size_t read = inner->ops->read(inner, buf, count TSRMLS_CC); + if (inner) { + size_t read = php_stream_read(inner, buf, count); stream->eof = inner->eof; return read; } @@ -99,8 +99,10 @@ static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, o { php_stream *inner = stream->abstract; - if (inner && inner->ops->seek) { - return inner->ops->seek(inner, offset, whence, newoffset TSRMLS_CC); + if (inner) { + int sought = php_stream_seek(inner, offset, whence); + *newoffset = inner->position; + return sought; } return -1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix ZTS build: ext/soap/soap.c
Commit:d4b673a34c873a7d732507ce5f83385acff8a59c Author:Michael Wallner Tue, 27 Aug 2013 14:01:59 +0200 Parents: bb1f9d3826c968ce0c099598ded6f646b3da6429 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d4b673a34c873a7d732507ce5f83385acff8a59c Log: fix ZTS build Changed paths: M ext/soap/soap.c Diff: diff --git a/ext/soap/soap.c b/ext/soap/soap.c index d10c17e..c5900dc 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1580,7 +1580,7 @@ PHP_METHOD(SoapServer, handle) array_init_size(&filter_params, 1); add_assoc_long_ex(&filter_params, ZEND_STRS("window"), 0x2f); /* ANY WBITS */ - zf = php_stream_filter_create("zlib.inflate", &filter_params, 0); + zf = php_stream_filter_create("zlib.inflate", &filter_params, 0 TSRMLS_CC); zval_dtor(&filter_params); if (zf) { @@ -1595,10 +1595,10 @@ PHP_METHOD(SoapServer, handle) } } - doc_request = soap_xmlParseFile("php://input"); + doc_request = soap_xmlParseFile("php://input" TSRMLS_CC); if (zf) { - php_stream_filter_remove(zf, 1); + php_stream_filter_remove(zf, 1 TSRMLS_CC); } } else { zval_ptr_dtor(&retval); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: make reading php://input JIT if enable_post_data_reading=0: ext/standard/php_fopen_wrapper.c main/SAPI.c main/SAPI.h
Commit:449d4c0b1c6ea0f5dfe7b56c99d9fc4f2033d27c Author:Michael Wallner Tue, 10 Sep 2013 13:13:33 +0200 Parents: e3e4d1b144a818b68e9332e75a35b2870c7253b8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=449d4c0b1c6ea0f5dfe7b56c99d9fc4f2033d27c Log: make reading php://input JIT if enable_post_data_reading=0 Changed paths: M ext/standard/php_fopen_wrapper.c M main/SAPI.c M main/SAPI.h diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index ca0b92e..aa7924d 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -63,6 +63,12 @@ php_stream_ops php_stream_output_ops = { NULL /* set_option */ }; +typedef struct php_stream_input { /* {{{ */ + php_stream **body_ptr; + off_t position; +} php_stream_input_t; +/* }}} */ + static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ { return -1; @@ -71,20 +77,52 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ { - php_stream *inner = stream->abstract; + php_stream_input_t *input = stream->abstract; + size_t read; + //fprintf(stderr, "Attempt to read %lu bytes (%lu)\n", count, SG(read_post_bytes)); + + if (!SG(post_read) && SG(read_post_bytes) < input->position + count) { + /* read requested data from SAPI */ + int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); + + //fprintf(stderr, "Did read %d bytes\n", read_bytes); + if (read_bytes > 0) { + php_stream_seek(*input->body_ptr, 0, SEEK_END); + php_stream_write(*input->body_ptr, buf, read_bytes); + } + } + + php_stream_seek(*input->body_ptr, input->position, SEEK_SET); + read = (*input->body_ptr)->ops->read(*input->body_ptr, buf, count TSRMLS_CC); + + if (!read || read == (size_t) -1) { + stream->eof = 1; + } else { + input->position += read; + } + + return read; +} +/* }}} */ + +static size_t php_stream_input_read_x(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +{ + php_stream_input_t *input = stream->abstract; + php_stream *inner = *input->body_ptr; if (inner && inner->ops->read) { size_t read = inner->ops->read(inner, buf, count TSRMLS_CC); stream->eof = inner->eof; return read; } - return -1; } /* }}} */ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { + efree(stream->abstract); + return 0; } /* }}} */ @@ -193,18 +231,23 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } if (!strcasecmp(path, "input")) { + php_stream_input_t *input; + if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } - if (SG(request_info).request_body) { - php_stream_rewind(SG(request_info).request_body); + + input = ecalloc(1, sizeof(*input)); + if (*(input->body_ptr = &SG(request_info).request_body)) { + php_stream_rewind(*input->body_ptr); } else { - sapi_read_standard_form_data(TSRMLS_C); + *input->body_ptr = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); } - return php_stream_alloc(&php_stream_input_ops, SG(request_info).request_body, 0, "rb"); + + return php_stream_alloc(&php_stream_input_ops, input, 0, "rb"); } if (!strcasecmp(path, "stdin")) { diff --git a/main/SAPI.c b/main/SAPI.c index ccfb1e5..9c8bcb1 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -180,10 +180,6 @@ SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) { if (SG(request_info).post_entry && SG(request_info).content_type_dup) { SG(request_info).post_entry->post_handler(SG(request_info).content_type_dup, arg TSRMLS_CC); - /*if (SG(request_info).request_body) { - php_stream_close(SG(request_info).request_body); - SG(request_info).request_body = NULL; - }*/ efree(SG(request_info).content_type_dup); SG(request_info).content_type_dup = NULL; } @@ -249,43 +245,61 @@ static void sapi_read_post_data(TSRMLS_D) }
[PHP-CVS] com php-src: remove unused code: ext/standard/php_fopen_wrapper.c
Commit:71bee63fad5418642c87c588cc9e22ca44186ce6 Author:Michael Wallner Tue, 10 Sep 2013 13:16:24 +0200 Parents: 832e2d0d8c8bb11644fe34ec1685fc68d9b3a475 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=71bee63fad5418642c87c588cc9e22ca44186ce6 Log: remove unused code Changed paths: M ext/standard/php_fopen_wrapper.c Diff: diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index aa7924d..27acb28 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -79,13 +79,11 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count { php_stream_input_t *input = stream->abstract; size_t read; - //fprintf(stderr, "Attempt to read %lu bytes (%lu)\n", count, SG(read_post_bytes)); if (!SG(post_read) && SG(read_post_bytes) < input->position + count) { /* read requested data from SAPI */ int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); - //fprintf(stderr, "Did read %d bytes\n", read_bytes); if (read_bytes > 0) { php_stream_seek(*input->body_ptr, 0, SEEK_END); php_stream_write(*input->body_ptr, buf, read_bytes); @@ -105,20 +103,6 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } /* }}} */ -static size_t php_stream_input_read_x(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ -{ - php_stream_input_t *input = stream->abstract; - php_stream *inner = *input->body_ptr; - - if (inner && inner->ops->read) { - size_t read = inner->ops->read(inner, buf, count TSRMLS_CC); - stream->eof = inner->eof; - return read; - } - return -1; -} -/* }}} */ - static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { efree(stream->abstract); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: slim post data: ext/mbstring/mb_gpc.c ext/soap/soap.c ext/standard/php_fopen_wrapper.c main/SAPI.c main/SAPI.h main/main.c main/php_content_types.c main/php_globals.h main/php_s
Commit:bb1f9d3826c968ce0c099598ded6f646b3da6429 Author:Michael Wallner Wed, 14 Aug 2013 14:42:36 +0200 Parents: a13c00cd14179971efd60e8acb450a615c2aff22 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bb1f9d3826c968ce0c099598ded6f646b3da6429 Log: slim post data Changed paths: M ext/mbstring/mb_gpc.c M ext/soap/soap.c M ext/standard/php_fopen_wrapper.c M main/SAPI.c M main/SAPI.h M main/main.c M main/php_content_types.c M main/php_globals.h M main/php_streams.h M main/php_variables.c M sapi/cli/php_cli_server.c D tests/basic/024.phpt D tests/basic/026.phpt diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 5ecc8f3..30764dc 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -364,6 +364,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) { const mbfl_encoding *detected; php_mb_encoding_handler_info_t info; + char *post_data_str = NULL; MBSTRG(http_input_identify_post) = NULL; @@ -376,7 +377,10 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); - detected = _php_mb_encoding_handler_ex(&info, arg, SG(request_info).post_data TSRMLS_CC); + php_stream_rewind(SG(request_info).request_body); + php_stream_copy_to_mem(SG(request_info).request_body, &post_data_str, PHP_STREAM_COPY_ALL, 0); + detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str TSRMLS_CC); + STR_FREE(post_data_str); MBSTRG(http_input_identify) = detected; if (detected) { diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 00e80ef..d10c17e 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1560,48 +1560,45 @@ PHP_METHOD(SoapServer, handle) } if (ZEND_NUM_ARGS() == 0) { - if (SG(request_info).raw_post_data) { - char *post_data = SG(request_info).raw_post_data; - int post_data_length = SG(request_info).raw_post_data_length; + if (SG(request_info).request_body && 0 == php_stream_rewind(SG(request_info).request_body)) { zval **server_vars, **encoding; + php_stream_filter *zf = NULL; zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && Z_TYPE_PP(server_vars) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && Z_TYPE_PP(encoding) == IS_STRING) { - zval func; - zval retval; - zval param; - zval *params[1]; - - if ((strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 || -strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0) && - zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) { - ZVAL_STRING(&func, "gzinflate", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data+10, post_data_length-10, 0); - INIT_PZVAL(params[0]); - } else if (strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 && - zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) { - ZVAL_STRING(&func, "gzuncompress", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data, post_data_length, 0); - INIT_PZVAL(params[0]); + + if (strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 + ) { + zval filter_params; + + INIT_PZVAL(&filter_params); + array_init_size(&filter_params, 1); + add_assoc_long_ex(&filter_params, ZEND_STRS("window"), 0x2f); /* ANY WBITS */ + + zf = php_stream_filter_create("zlib.inflate", &filter_params, 0); + zval_dtor(&filter_params); + + if (zf) { + p
[PHP-CVS] com php-src: Merge branch 'slim-postdata-merge': ext/soap/soap.c ext/standard/php_fopen_wrapper.c main/SAPI.c
Commit:423c70fb4d79b7831b1db41ea217c8e1afd5cf8e Author:Michael Wallner Tue, 17 Sep 2013 13:52:25 +0200 Parents: 0f78d8612a7b16f1bbe3fb80a99896d7163c0aa7 71bee63fad5418642c87c588cc9e22ca44186ce6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=423c70fb4d79b7831b1db41ea217c8e1afd5cf8e Log: Merge branch 'slim-postdata-merge' * slim-postdata-merge: remove unused code tests make reading php://input JIT if enable_post_data_reading=0 revert stream cast fix ZTS build slim post data Conflicts: ext/soap/soap.c ext/standard/php_fopen_wrapper.c main/SAPI.c Changed paths: MM ext/soap/soap.c MM ext/standard/php_fopen_wrapper.c MM main/SAPI.c Diff: diff --cc ext/soap/soap.c index d10c17e,c5900dc..980c924 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@@ -1595,11 -1595,11 +1595,10 @@@ PHP_METHOD(SoapServer, handle } } - doc_request = soap_xmlParseFile("php://input"); + doc_request = soap_xmlParseFile("php://input" TSRMLS_CC); if (zf) { - php_stream_filter_remove(zf, 1); - } + php_stream_filter_remove(zf, 1 TSRMLS_CC); - } } else { zval_ptr_dtor(&retval); return; diff --cc main/SAPI.c index ccfb1e5,9c8bcb1..8ee7649 --- a/main/SAPI.c +++ b/main/SAPI.c @@@ -259,6 -274,7 +274,8 @@@ SAPI_API SAPI_POST_READER_FUNC(sapi_rea SG(request_info).content_length, SG(post_max_size)); return; } + ++ SG(request_info).request_body = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); if (sapi_module.read_post) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: final bits: ext/soap/soap.c ext/standard/php_fopen_wrapper.c
Commit:e6084da4735c945cb071c4d9259ea0d702eb77c6 Author:Michael Wallner Tue, 17 Sep 2013 13:59:49 +0200 Parents: 423c70fb4d79b7831b1db41ea217c8e1afd5cf8e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e6084da4735c945cb071c4d9259ea0d702eb77c6 Log: final bits Changed paths: M ext/soap/soap.c M ext/standard/php_fopen_wrapper.c Diff: diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 980c924..c5900dc 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1599,6 +1599,7 @@ PHP_METHOD(SoapServer, handle) if (zf) { php_stream_filter_remove(zf, 1 TSRMLS_CC); + } } else { zval_ptr_dtor(&retval); return; diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 064eee2..76f77eb 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -91,7 +91,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } php_stream_seek(*input->body_ptr, input->position, SEEK_SET); - read = (*input->body_ptr)->ops->read(*input->body_ptr, buf, count TSRMLS_CC); + read = php_stream_read(*input->body_ptr, buf, count); if (!read || read == (size_t) -1) { stream->eof = 1; @@ -105,6 +105,9 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { + efree(stream->abstract); + stream->abstract = NULL; + return 0; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: tests: tests/basic/enable_post_data_reading_01.phpt tests/basic/enable_post_data_reading_02.phpt tests/basic/enable_post_data_reading_03.phpt tests/basic/enable_post_data_readin
Commit:832e2d0d8c8bb11644fe34ec1685fc68d9b3a475 Author:Michael Wallner Tue, 10 Sep 2013 13:14:02 +0200 Parents: 449d4c0b1c6ea0f5dfe7b56c99d9fc4f2033d27c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=832e2d0d8c8bb11644fe34ec1685fc68d9b3a475 Log: tests Changed paths: M tests/basic/enable_post_data_reading_01.phpt M tests/basic/enable_post_data_reading_02.phpt M tests/basic/enable_post_data_reading_03.phpt M tests/basic/enable_post_data_reading_04.phpt A tests/basic/enable_post_data_reading_05.phpt A tests/basic/enable_post_data_reading_06.phpt diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt index 1a0e33f..19ee5d5 100644 --- a/tests/basic/enable_post_data_reading_01.phpt +++ b/tests/basic/enable_post_data_reading_01.phpt @@ -11,6 +11,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -20,3 +21,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt index dc7f6b1..4e1643e 100644 --- a/tests/basic/enable_post_data_reading_02.phpt +++ b/tests/basic/enable_post_data_reading_02.phpt @@ -15,6 +15,7 @@ Content-Type: text/plain-file var_dump($_FILES); var_dump($_POST); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -26,3 +27,9 @@ Content-Type: text/plain-file 1 -20896060251896012921717172737--" +string(%d) "-20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-20896060251896012921717172737--" diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt index cdabe91..6a62282 100644 --- a/tests/basic/enable_post_data_reading_03.phpt +++ b/tests/basic/enable_post_data_reading_03.phpt @@ -12,6 +12,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -21,3 +22,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt index a168504..a7c7e49 100644 --- a/tests/basic/enable_post_data_reading_04.phpt +++ b/tests/basic/enable_post_data_reading_04.phpt @@ -12,6 +12,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -21,3 +22,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_05.phpt b/tests/basic/enable_post_data_reading_05.phpt new file mode 100644 index 000..d8efa01 --- /dev/null +++ b/tests/basic/enable_post_data_reading_05.phpt @@ -0,0 +1,26 @@ +--TEST-- +enable_post_data_reading: using multiple input streams +--INI-- +enable_post_data_reading=0 +max_execution_time=2 +--POST_RAW-- +Content-Type: application/unknown +One line of data +--FILE-- + + +Done +--EXPECT-- +Test +OOnnee lliinnee ooff ddaattaa +Done diff --git a/tests/basic/enable_post_data_reading_06.phpt b/tests/basic/enable_post_data_reading_06.phpt new file mode 100644 index 000..fbed195 --- /dev/null +++ b/tests/basic/enable_post_data_reading_06.phpt @@ -0,0 +1,271 @@ +--TEST-- +enable_post_data_reading: using multiple input streams (more than 8k data) +--INI-- +enable_post_data_reading=0 +--POST_RAW-- +Content-Type: application/unknown +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +01234567890123456789012345678901234567890123456789012345678901234567890123456789012
[PHP-CVS] com php-src: let the libsqlite3 symbols be exported in dll: ext/sqlite3/config.w32
Commit:41d78110ffd576a9afa352426ed2c15ab7308bec Author:Anatol Belski Tue, 17 Sep 2013 13:05:44 +0200 Parents: 512734b58dc4e231971901cb87656d67c87e7645 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=41d78110ffd576a9afa352426ed2c15ab7308bec Log: let the libsqlite3 symbols be exported in dll Changed paths: M ext/sqlite3/config.w32 Diff: diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32 index 01e4625..8ddb6b9 100644 --- a/ext/sqlite3/config.w32 +++ b/ext/sqlite3/config.w32 @@ -4,7 +4,7 @@ ARG_WITH("sqlite3", "SQLite 3 support", "no"); if (PHP_SQLITE3 != "no") { - ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 "); + ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) "); EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname); ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3"); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: slim post data: ext/mbstring/mb_gpc.c ext/soap/soap.c ext/standard/php_fopen_wrapper.c main/SAPI.c main/SAPI.h main/main.c main/php_content_types.c main/php_globals.h main/p
There seem to still be issues with soap -- I'm on it. On 27 August 2013 13:31, Michael Wallner wrote: > Commit:2438490addfbfba51e12246a74588b2382caa08a > Author:Michael Wallner Wed, 14 Aug 2013 14:42:36 > +0200 > Parents: fddc82dd0ebb4f7bb24921682251b79970315fbf > Branches: master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=2438490addfbfba51e12246a74588b2382caa08a > > Log: > slim post data > > Changed paths: > M ext/mbstring/mb_gpc.c > M ext/soap/soap.c > M ext/standard/php_fopen_wrapper.c > M main/SAPI.c > M main/SAPI.h > M main/main.c > M main/php_content_types.c > M main/php_globals.h > M main/php_streams.h > M main/php_variables.c > M sapi/cli/php_cli_server.c > D tests/basic/024.phpt > D tests/basic/026.phpt > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Patch for https://bugs.php.net/bug.php?id=44522 to allow uploading files above 2G.: main/SAPI.h main/rfc1867.c sapi/cgi/cgi_main.c
Commit:da04b2e28c6ccc73bfab542ed4dd5eada343e592 Author:Ralf Lang Fri, 28 Jun 2013 08:32:10 +0200 Parents: a441d9274b0045de20402b3912d04ca3de57365d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=da04b2e28c6ccc73bfab542ed4dd5eada343e592 Log: Patch for https://bugs.php.net/bug.php?id=44522 to allow uploading files above 2G. This is essentially the same as the patch "uploads_larger_than_2g_HEAD_v2 (last revision 2012-03-26 03:59 UTC) by jason at infininull dot com)" but using off_t instead of signed long (originally: uint) I tested this on 64bit linux and succeeded uploading a file of 4.8 G. The File did not get corrupted or truncated in any way. I did not yet test this under windows or 32 bit linux Note that there are still limitations: * Did not test for files > 8 G * php does not yet reject absurdly high values * Still limited by underlying file system specific limits and free space * in upload * tmp dir and destination dir Changed paths: M main/SAPI.h M main/rfc1867.c M sapi/cgi/cgi_main.c Diff: diff --git a/main/SAPI.h b/main/SAPI.h index 92b7329..c3cacb5 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -82,7 +82,7 @@ typedef struct { char *post_data, *raw_post_data; char *cookie_data; long content_length; - uint post_data_length, raw_post_data_length; + off_t post_data_length, raw_post_data_length; char *path_translated; char *request_uri; @@ -119,7 +119,7 @@ typedef struct _sapi_globals_struct { void *server_context; sapi_request_info request_info; sapi_headers_struct sapi_headers; - int read_post_bytes; + off_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 ed7ce9c..78a7ad2 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -676,8 +676,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; + off_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; diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9e6b74a..ec7b963 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) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Use int64_t and atoll() after discussion with johannes: main/SAPI.h main/rfc1867.c
Commit:a2394df90e86a24a61f1267b5767017e2e769b2a Author:Ralf Lang Mon, 22 Jul 2013 18:03:11 +0200 Parents: f978f11e2e599258cdbdc699cfccd5d961eb8c36 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a2394df90e86a24a61f1267b5767017e2e769b2a Log: Use int64_t and atoll() after discussion with johannes Changed paths: M main/SAPI.h M main/rfc1867.c Diff: diff --git a/main/SAPI.h b/main/SAPI.h index c3cacb5..6d5434d 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -82,7 +82,7 @@ typedef struct { char *post_data, *raw_post_data; char *cookie_data; long content_length; - off_t post_data_length, raw_post_data_length; + int64_t post_data_length, raw_post_data_length; char *path_translated; char *request_uri; @@ -119,7 +119,7 @@ typedef struct _sapi_globals_struct { void *server_context; sapi_request_info request_info; sapi_headers_struct sapi_headers; - off_t 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 452b6a3..d3adf47 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -677,7 +677,7 @@ 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; - off_t total_bytes = 0, max_file_size = 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; @@ -899,7 +899,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); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: make this work in vc11 too: main/SAPI.h main/rfc1867.c
Commit:b07e55fdeba5d3e415671c0981e3041841b2485e Author:Ralf Lang Mon, 22 Jul 2013 21:26:38 +0200 Parents: a2394df90e86a24a61f1267b5767017e2e769b2a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b07e55fdeba5d3e415671c0981e3041841b2485e Log: make this work in vc11 too Changed paths: M main/SAPI.h M main/rfc1867.c Diff: diff --git a/main/SAPI.h b/main/SAPI.h index 6d5434d..6fc60c8 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 diff --git a/main/rfc1867.c b/main/rfc1867.c index d3adf47..8460929 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -34,6 +34,10 @@ #include "rfc1867.h" #include "ext/standard/php_string.h" +#if defined(_MSC_VER) +# define atoll(s) _atoi64(s) +#endif + #define DEBUG_FILE_UPLOAD ZEND_DEBUG static int dummy_encoding_translation(TSRMLS_D) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ws: main/rfc1867.c
Commit:f978f11e2e599258cdbdc699cfccd5d961eb8c36 Author:Ralf Lang Fri, 28 Jun 2013 08:38:34 +0200 Parents: da04b2e28c6ccc73bfab542ed4dd5eada343e592 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f978f11e2e599258cdbdc699cfccd5d961eb8c36 Log: ws Changed paths: M main/rfc1867.c Diff: diff --git a/main/rfc1867.c b/main/rfc1867.c index 78a7ad2..452b6a3 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -677,7 +677,7 @@ 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; - off_t total_bytes = 0, max_file_size = 0; + off_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; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add NEWS entry; add simple test: NEWS sapi/cli/tests/php_cli_server.inc sapi/cli/tests/upload_2G.phpt
Commit:15c351cc52971eb9a1a6c16a760cc0f681c5 Author:Michael Wallner Mon, 5 Aug 2013 13:53:35 +0200 Parents: 69aed1b61fd87633a4decc75e190abc24848172a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=15c351cc52971eb9a1a6c16a760cc0f681c5 Log: add NEWS entry; add simple test Changed paths: M NEWS M sapi/cli/tests/php_cli_server.inc A sapi/cli/tests/upload_2G.phpt Diff: diff --git a/NEWS b/NEWS index c679b90..3ef4a97 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Improved IS_VAR operands fetching. (Laruence, Dmitry) . Implemented internal operator overloading (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + . Enabled file uploads greater than 2G (Ralf Lang, Mike) - mysqlnd: . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 40c5361..77a79e0 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -3,7 +3,7 @@ define ("PHP_CLI_SERVER_HOSTNAME", "localhost"); define ("PHP_CLI_SERVER_PORT", 8964); define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT); -function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) { +function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE, $cmd_args = null) { $php_executable = getenv('TEST_PHP_EXECUTABLE'); $doc_root = __DIR__; $router = "index.php"; @@ -19,14 +19,14 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) ); if (substr(PHP_OS, 0, 3) == 'WIN') { - $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); } else { - $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt new file mode 100644 index 000..c7ae5c6 --- /dev/null +++ b/sapi/cli/tests/upload_2G.phpt @@ -0,0 +1,99 @@ +--TEST-- +file upload greater than 2G +--SKIPIF-- +=8"); +} + +if ($f = fopen("/proc/meminfo","r")) { + while (!feof($f)) { + if (!strncmp($line = fgets($f), "MemFree", 7)) { + if (substr($line,8)/1024/1024 > 3) { + $enough_free_ram = true; + } + } + } +} + +if (empty($enough_free_ram)) { + die("need +3G free RAM"); +} +?> +--FILE-- + +Done +--EXPECTF-- +Test + +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: PHP/%s +Content-type: text/html + +array(1) { + ["file1"]=> + array(5) { +["name"]=> +string(9) "file1.txt" +["type"]=> +string(10) "text/plain" +["tmp_name"]=> +string(14) "/tmp/php%s" +["error"]=> +int(0) +["size"]=> +int(215000) + } +} +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: NEWS/UPGRADING{,.INTERNALS} notes about temp POST stream: NEWS UPGRADING UPGRADING.INTERNALS
Commit:4a3936ef4abdeb72c7d323fe4b6a65e1ae0ef181 Author:Michael Wallner Tue, 17 Sep 2013 11:08:23 +0200 Parents: 1c15d70cbd91e3f502694a31704e959cf734d8da Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4a3936ef4abdeb72c7d323fe4b6a65e1ae0ef181 Log: NEWS/UPGRADING{,.INTERNALS} notes about temp POST stream Changed paths: M NEWS M UPGRADING M UPGRADING.INTERNALS Diff: diff --git a/NEWS b/NEWS index 60fac8c..540f896 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ PHP NEWS (Gustavo) . Uploads equal or greater than 2GB in size are now accepted. (Ralf Lang, Mike) + . Reduced POST data memory usage by 200-300%. Removed INI setting +always_populate_raw_post_data and the $HTTP_RAW_POST_DATA global +variable. (Mike) - cURL: . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir diff --git a/UPGRADING b/UPGRADING index e9fba51..f5e7cd0 100755 --- a/UPGRADING +++ b/UPGRADING @@ -20,11 +20,23 @@ PHP X.Y UPGRADE NOTES 1. Backward Incompatible Changes +- Core: + Removed $HTTP_RAW_POST_DATA global variable. Restore backwards compatibility + by: + 2. New Features +- Core: + The php://input stream is now re-usable and can be used concurrently with + enable_post_data_reading=0. 2. Changes in SAPI modules @@ -91,6 +103,8 @@ PHP X.Y UPGRADE NOTES 10. Changes to INI File Handling +- Core: + Removed always_populate_raw_post_data. 11. Other Changes diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 7cb5539..90202f0 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -5,6 +5,7 @@ UPGRADE NOTES - PHP X.Y 1. Internal API changes a. Addition of do_operation and compare object handlers b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros + c. POST data handling 2. Build system changes a. Unix build system changes @@ -57,6 +58,15 @@ UPGRADE NOTES - PHP X.Y The macros behave similarly to the non-FAST variants with copy=1 and dtor=0, but will try to return the zval without making a copy by utilizing return_value_ptr. + + c. POST data handling + + The sapi_request_info's members post_data, post_data_len and raw_post_data as + well as raw_post_data_len have been replaced with a temp PHP stream + request_body. + + The recommended way to access raw POST data is to open and use a php://input + stream wrapper. It is safe to be used concurrently and more than once. 2. Build system changes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'slim-postdata': main/main.c main/php_variables.c sapi/cli/php_cli_server.c
Commit:1c15d70cbd91e3f502694a31704e959cf734d8da Author:Michael Wallner Tue, 17 Sep 2013 10:50:49 +0200 Parents: 52ff129607a7193cccbc6bdfbf1c1e8586e8d0d2 2438490addfbfba51e12246a74588b2382caa08a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c15d70cbd91e3f502694a31704e959cf734d8da Log: Merge branch 'slim-postdata' * slim-postdata: slim post data add NEWS entry; add simple test more precise condition make this work in vc11 too Use int64_t and atoll() after discussion with johannes ws Patch for https://bugs.php.net/bug.php?id=44522 to allow uploading files above 2G. Changed paths: MM main/main.c MM main/php_variables.c MM sapi/cli/php_cli_server.c Diff: diff --cc sapi/cli/php_cli_server.c index d50cc4f,5ec4143..5e0f6e95 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@@ -1723,10 -1726,9 +1723,9 @@@ static void php_cli_server_client_popul request_info->request_uri = client->request.request_uri; request_info->path_translated = client->request.path_translated; request_info->query_string = client->request.query_string; - request_info->post_data = client->request.content; - request_info->content_length = request_info->post_data_length = client->request.content_len; + request_info->content_length = client->request.content_len; request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; - if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) { request_info->content_type = *val; } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of github.com:/ralflang/php-src: sapi/cgi/cgi_main.c
Commit:69aed1b61fd87633a4decc75e190abc24848172a Author:Michael Wallner Mon, 5 Aug 2013 12:02:10 +0200 Parents: 7ca7ea85cd5db249be6348ab10914c39bcae6c69 d80a91018dc0d7b771cf8517f788a408f3a4f473 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=69aed1b61fd87633a4decc75e190abc24848172a Log: 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 Bugs: https://bugs.php.net/372 Changed paths: MM sapi/cgi/cgi_main.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: more precise condition: main/rfc1867.c
Commit:d80a91018dc0d7b771cf8517f788a408f3a4f473 Author:Ralf Lang Tue, 23 Jul 2013 07:39:36 +0200 Parents: b07e55fdeba5d3e415671c0981e3041841b2485e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d80a91018dc0d7b771cf8517f788a408f3a4f473 Log: more precise condition Changed paths: M main/rfc1867.c Diff: diff --git a/main/rfc1867.c b/main/rfc1867.c index 8460929..3c16070 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -34,7 +34,7 @@ #include "rfc1867.h" #include "ext/standard/php_string.h" -#if defined(_MSC_VER) +#if defined(PHP_WIN32) && !defined(HAVE_ATOLL) # define atoll(s) _atoi64(s) #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: slim post data: ext/mbstring/mb_gpc.c ext/soap/soap.c ext/standard/php_fopen_wrapper.c main/SAPI.c main/SAPI.h main/main.c main/php_content_types.c main/php_globals.h main/php_s
Commit:2438490addfbfba51e12246a74588b2382caa08a Author:Michael Wallner Wed, 14 Aug 2013 14:42:36 +0200 Parents: fddc82dd0ebb4f7bb24921682251b79970315fbf Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2438490addfbfba51e12246a74588b2382caa08a Log: slim post data Changed paths: M ext/mbstring/mb_gpc.c M ext/soap/soap.c M ext/standard/php_fopen_wrapper.c M main/SAPI.c M main/SAPI.h M main/main.c M main/php_content_types.c M main/php_globals.h M main/php_streams.h M main/php_variables.c M sapi/cli/php_cli_server.c D tests/basic/024.phpt D tests/basic/026.phpt diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 5ecc8f3..30764dc 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -364,6 +364,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) { const mbfl_encoding *detected; php_mb_encoding_handler_info_t info; + char *post_data_str = NULL; MBSTRG(http_input_identify_post) = NULL; @@ -376,7 +377,10 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); - detected = _php_mb_encoding_handler_ex(&info, arg, SG(request_info).post_data TSRMLS_CC); + php_stream_rewind(SG(request_info).request_body); + php_stream_copy_to_mem(SG(request_info).request_body, &post_data_str, PHP_STREAM_COPY_ALL, 0); + detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str TSRMLS_CC); + STR_FREE(post_data_str); MBSTRG(http_input_identify) = detected; if (detected) { diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 00e80ef..d10c17e 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1560,48 +1560,45 @@ PHP_METHOD(SoapServer, handle) } if (ZEND_NUM_ARGS() == 0) { - if (SG(request_info).raw_post_data) { - char *post_data = SG(request_info).raw_post_data; - int post_data_length = SG(request_info).raw_post_data_length; + if (SG(request_info).request_body && 0 == php_stream_rewind(SG(request_info).request_body)) { zval **server_vars, **encoding; + php_stream_filter *zf = NULL; zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && Z_TYPE_PP(server_vars) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && Z_TYPE_PP(encoding) == IS_STRING) { - zval func; - zval retval; - zval param; - zval *params[1]; - - if ((strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 || -strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0) && - zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) { - ZVAL_STRING(&func, "gzinflate", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data+10, post_data_length-10, 0); - INIT_PZVAL(params[0]); - } else if (strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 && - zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) { - ZVAL_STRING(&func, "gzuncompress", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data, post_data_length, 0); - INIT_PZVAL(params[0]); + + if (strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 + ) { + zval filter_params; + + INIT_PZVAL(&filter_params); + array_init_size(&filter_params, 1); + add_assoc_long_ex(&filter_params, ZEND_STRS("window"), 0x2f); /* ANY WBITS */ + + zf = php_stream_filter_create("zlib.inflate", &filter_params, 0); + zval_dtor(&filter_params); + + if (zf) { + p
[PHP-CVS] com php-src: Exclude bison 3.0 by Mike: Zend/acinclude.m4
Commit:be581ec66d2e9085e9e12a70cbec227be00b8725 Author:Xinchen Hui Tue, 17 Sep 2013 16:54:27 +0800 Parents: 52ff129607a7193cccbc6bdfbf1c1e8586e8d0d2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=be581ec66d2e9085e9e12a70cbec227be00b8725 Log: Exclude bison 3.0 by Mike Changed paths: M Zend/acinclude.m4 Diff: diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index fe3ab63..7fa8c99 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ # non-working versions, e.g. "3.0 3.2"; # remove "none" when introducing the first incompatible bison version an # separate any following additions by spaces - bison_version_exclude="none" + bison_version_exclude="3.0" # for standalone build of Zend Engine test -z "$SED" && SED=sed -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/filter/logical_filters.c
Commit:5e3da04fb033734d2e69542fe835660c0df8dc48 Author:David Soria Parra Tue, 17 Sep 2013 09:55:03 +0200 Parents: 3d6ac70e6652c2c15b180e3f34fdc061e47f68a4 dfd7d1063a5292b04f6134284337550f4f513749 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5e3da04fb033734d2e69542fe835660c0df8dc48 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: NEWS for added reserved ip addresses according to RFC 6598 Add RFC 6598 IPs to reserved addresses Changed paths: MM ext/filter/logical_filters.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add RFC 6598 IPs to reserved addresses: ext/filter/logical_filters.c ext/filter/tests/018.phpt
Commit:7c279df6ae29d58502139c07fa51f4373075 Author:Sebastian Nohn Sun, 15 Sep 2013 19:18:20 +0200 Committer: David Soria Parra Tue, 17 Sep 2013 09:52:53 +0200 Parents: 6a0b90da84433ab1b0844a96036f3185d8a29cef Branches: PHP-5.4 PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c279df6ae29d58502139c07fa51f4373075 Log: Add RFC 6598 IPs to reserved addresses (cherry picked from commit b3f5b822e9f83d99d7cb5eed36ba8d307d1408ee) Changed paths: M ext/filter/logical_filters.c M ext/filter/tests/018.phpt Diff: diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index c8f94a7..71c5aba 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -714,6 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_RES_RANGE) { if ( (ip[0] == 0) || + (ip[0] == 100 && (ip[1] == 0 || ip[1] <= 127)) || (ip[0] == 128 && ip[1] == 0) || (ip[0] == 191 && ip[1] == 255) || (ip[0] == 169 && ip[1] == 254) || diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt index af52b2e..9c73fc3 100644 --- a/ext/filter/tests/018.phpt +++ b/ext/filter/tests/018.phpt @@ -15,6 +15,8 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)); var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP)); var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP)); var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP)); @@ -40,6 +42,8 @@ bool(false) string(12) "192.0.34.166" bool(false) string(9) "192.0.0.1" +bool(false) +bool(false) string(12) "192.0.34.166" bool(false) string(15) "255.255.255.255" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: NEWS for added reserved ip addresses according to RFC 6598: NEWS
Commit:dfd7d1063a5292b04f6134284337550f4f513749 Author:David Soria Parra Tue, 17 Sep 2013 09:54:58 +0200 Parents: 7c279df6ae29d58502139c07fa51f4373075 Branches: PHP-5.4 PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dfd7d1063a5292b04f6134284337550f4f513749 Log: NEWS for added reserved ip addresses according to RFC 6598 Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index b1280b3..d8895bd 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ PHP NEWS message). (Boro Sitnikovski) - Filter: + . Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn) . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names). (Syra) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php