[PHP-CVS] svn: /php/php-src/trunk/ext/zlib/ php_zlib.h tests/bug61287.phpt zlib.c
mike Mon, 05 Mar 2012 15:35:22 + Revision: http://svn.php.net/viewvc?view=revision&revision=323916 Log: fix bug #61287 (A particular string fails to decompress) Bug: https://bugs.php.net/61287 (Assigned) A particular string fails to decompress Changed paths: U php/php-src/trunk/ext/zlib/php_zlib.h A php/php-src/trunk/ext/zlib/tests/bug61287.phpt U php/php-src/trunk/ext/zlib/zlib.c Modified: php/php-src/trunk/ext/zlib/php_zlib.h === --- php/php-src/trunk/ext/zlib/php_zlib.h 2012-03-05 15:33:38 UTC (rev 323915) +++ php/php-src/trunk/ext/zlib/php_zlib.h 2012-03-05 15:35:22 UTC (rev 323916) @@ -65,6 +65,7 @@ #define phpext_zlib_ptr zlib_module_ptr #ifdef ZTS +# include "TSRM.h" # define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) #else # define ZLIBG(v) (zlib_globals.v) Added: php/php-src/trunk/ext/zlib/tests/bug61287.phpt === --- php/php-src/trunk/ext/zlib/tests/bug61287.phpt (rev 0) +++ php/php-src/trunk/ext/zlib/tests/bug61287.phpt 2012-03-05 15:35:22 UTC (rev 323916) @@ -0,0 +1,24 @@ +--TEST-- +bug #61287 - inflate needs the terminating null byte +--SKIPIF-- + 1, +'discipline' => 23, +'degrees' => array(), +'country_id' => 27 +); + +$serialized = serialize($array); + +$deflated = gzdeflate($serialized, 9); +$inflated = gzinflate($deflated); + +echo strlen($inflated),"\n"; +?> +Done +--EXPECT-- +92 +Done Modified: php/php-src/trunk/ext/zlib/zlib.c === --- php/php-src/trunk/ext/zlib/zlib.c 2012-03-05 15:33:38 UTC (rev 323915) +++ php/php-src/trunk/ext/zlib/zlib.c 2012-03-05 15:35:22 UTC (rev 323916) @@ -400,7 +400,7 @@ status = inflateInit2(&Z, encoding); if (Z_OK == status) { Z.next_in = (Bytef *) in_buf; - Z.avail_in = in_len; + Z.avail_in = in_len + 1; /* NOTE: data must be zero terminated */ switch (status = php_zlib_inflate_rounds(&Z, max_len, out_buf, out_len)) { case Z_STREAM_END: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/zlib/php_zlib.h ext/zlib/tests/bug61287.phpt ext/zlib/zlib.c
mike Mon, 05 Mar 2012 15:38:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=323917 Log: MFH: Fixed bug #61287 (A particular string fails to decompress) Bug: https://bugs.php.net/61287 (Assigned) A particular string fails to decompress Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h A + php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt (from php/php-src/trunk/ext/zlib/tests/bug61287.phpt:r323916) U php/php-src/branches/PHP_5_4/ext/zlib/zlib.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-03-05 15:35:22 UTC (rev 323916) +++ php/php-src/branches/PHP_5_4/NEWS 2012-03-05 15:38:24 UTC (rev 323917) @@ -61,6 +61,7 @@ - Zlib: . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita Popov) + . Fixed bug #61287 (A particular string fails to decompress). (Mike) 01 Mar 2012, PHP 5.4.0 Modified: php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h === --- php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h2012-03-05 15:35:22 UTC (rev 323916) +++ php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h2012-03-05 15:38:24 UTC (rev 323917) @@ -65,6 +65,7 @@ #define phpext_zlib_ptr zlib_module_ptr #ifdef ZTS +# include "TSRM.h" # define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) #else # define ZLIBG(v) (zlib_globals.v) Copied: php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt (from rev 323916, php/php-src/trunk/ext/zlib/tests/bug61287.phpt) === --- php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt 2012-03-05 15:38:24 UTC (rev 323917) @@ -0,0 +1,24 @@ +--TEST-- +bug #61287 - inflate needs the terminating null byte +--SKIPIF-- + 1, +'discipline' => 23, +'degrees' => array(), +'country_id' => 27 +); + +$serialized = serialize($array); + +$deflated = gzdeflate($serialized, 9); +$inflated = gzinflate($deflated); + +echo strlen($inflated),"\n"; +?> +Done +--EXPECT-- +92 +Done Modified: php/php-src/branches/PHP_5_4/ext/zlib/zlib.c === --- php/php-src/branches/PHP_5_4/ext/zlib/zlib.c2012-03-05 15:35:22 UTC (rev 323916) +++ php/php-src/branches/PHP_5_4/ext/zlib/zlib.c2012-03-05 15:38:24 UTC (rev 323917) @@ -400,7 +400,7 @@ status = inflateInit2(&Z, encoding); if (Z_OK == status) { Z.next_in = (Bytef *) in_buf; - Z.avail_in = in_len; + Z.avail_in = in_len + 1; /* NOTE: data must be zero terminated */ switch (status = php_zlib_inflate_rounds(&Z, max_len, out_buf, out_len)) { case Z_STREAM_END: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/run-tests.php PHP_5_4/run-tests.php
mike Fri, 09 Mar 2012 19:51:09 + Revision: http://svn.php.net/viewvc?view=revision&revision=324068 Log: merge 322758 (detect a php-cgi which is a sibling of php cli) Changed paths: _U php/php-src/branches/PHP_5_3/ U php/php-src/branches/PHP_5_3/run-tests.php _U php/php-src/branches/PHP_5_4/ U php/php-src/branches/PHP_5_4/run-tests.php Property changes on: php/php-src/branches/PHP_5_3 ___ Modified: svn:mergeinfo - /php/php-src/trunk:284726,305015,305018-305019 + /php/php-src/trunk:284726,305015,305018-305019,322758 Modified: php/php-src/branches/PHP_5_3/run-tests.php === --- php/php-src/branches/PHP_5_3/run-tests.php 2012-03-09 18:38:18 UTC (rev 324067) +++ php/php-src/branches/PHP_5_3/run-tests.php 2012-03-09 19:51:09 UTC (rev 324068) @@ -1357,6 +1357,9 @@ } else if (file_exists("./sapi/cgi/php-cgi")) { $old_php = $php; $php = realpath("./sapi/cgi/php-cgi") . ' -C '; + } else if (file_exists(dirname($php) . "/php-cgi")) { + $old_php = $php; + $php = realpath(dirname($php) . "/php-cgi") . ' -C '; } else { show_result('SKIP', $tested, $tested_file, "reason: CGI not available"); if ($JUNIT) { Property changes on: php/php-src/branches/PHP_5_4 ___ Modified: svn:mergeinfo - /php/php-src/trunk:284726,322419,322421,322423,322963 + /php/php-src/trunk:284726,322419,322421,322423,322758,322963 Modified: php/php-src/branches/PHP_5_4/run-tests.php === --- php/php-src/branches/PHP_5_4/run-tests.php 2012-03-09 18:38:18 UTC (rev 324067) +++ php/php-src/branches/PHP_5_4/run-tests.php 2012-03-09 19:51:09 UTC (rev 324068) @@ -1357,6 +1357,9 @@ } else if (file_exists("./sapi/cgi/php-cgi")) { $old_php = $php; $php = realpath("./sapi/cgi/php-cgi") . ' -C '; + } else if (file_exists(dirname($php) . "/php-cgi")) { + $old_php = $php; + $php = realpath(dirname($php) . "/php-cgi") . ' -C '; } else { show_result('SKIP', $tested, $tested_file, "reason: CGI not available"); if ($JUNIT) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php
mike Sat, 17 Mar 2012 09:35:25 + Revision: http://svn.php.net/viewvc?view=revision&revision=324319 Log: add --PUT-- section support based on POST_RAW Changed paths: U php/php-src/branches/PHP_5_3/run-tests.php U php/php-src/branches/PHP_5_4/run-tests.php U php/php-src/trunk/run-tests.php Modified: php/php-src/branches/PHP_5_3/run-tests.php === --- php/php-src/branches/PHP_5_3/run-tests.php 2012-03-17 09:19:10 UTC (rev 324318) +++ php/php-src/branches/PHP_5_3/run-tests.php 2012-03-17 09:35:25 UTC (rev 324319) @@ -1342,8 +1342,8 @@ $tested = trim($section_text['TEST']); - /* For GET/POST tests, check if cgi sapi is available and if it is, use it. */ - if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) { + /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */ + if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) { if (isset($php_cgi)) { $old_php = $php; $php = $php_cgi . ' -C '; @@ -1718,6 +1718,46 @@ save_text($tmp_post, $request); $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + } elseif (array_key_exists('PUT', $section_text) && !empty($section_text['PUT'])) { + + $post = trim($section_text['PUT']); + $raw_lines = explode("\n", $post); + + $request = ''; + $started = false; + + foreach ($raw_lines as $line) { + + if (empty($env['CONTENT_TYPE']) && preg_match('/^Content-Type:(.*)/i', $line, $res)) { + $env['CONTENT_TYPE'] = trim(str_replace("\r", '', $res[1])); + continue; + } + + if ($started) { + $request .= "\n"; + } + + $started = true; + $request .= $line; + } + + $env['CONTENT_LENGTH'] = strlen($request); + $env['REQUEST_METHOD'] = 'PUT'; + + if (empty($request)) { + if ($JUNIT) { + $JUNIT['test_total']++; + $JUNIT['test_error']++; + $JUNIT['result_xml'] .= ''."\n"; + $JUNIT['result_xml'] .= ''."\n"; + $JUNIT['result_xml'] .= ''."\n"; + } + return 'BORKED'; + } + + save_text($tmp_post, $request); + $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + } else if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { $post = trim($section_text['POST']); Modified: php/php-src/branches/PHP_5_4/run-tests.php === --- php/php-src/branches/PHP_5_4/run-tests.php 2012-03-17 09:19:10 UTC (rev 324318) +++ php/php-src/branches/PHP_5_4/run-tests.php 2012-03-17 09:35:25 UTC (rev 324319) @@ -1342,8 +1342,8 @@ $tested = trim($section_text['TEST']); - /* For GET/POST tests, check if cgi sapi is available and if it is, use it. */ - if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) { + /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */ + if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) { if (isset($php_cgi)) { $old_php = $php; $php = $php_cgi . ' -C '; @@ -1718,6 +1718,46 @@ save_text($tmp_post, $request); $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + } elseif (array_key_exists('PUT', $section_text) && !empty($section_text['PUT'])) { + + $post = trim($section_text['PUT']); + $raw_lines = explode("\n", $post); + + $request = ''; + $started = false; + + foreach ($raw_lines as $line) { + + if (empty($env['CONTENT_TYPE']) && preg_match('/^Content-Type:(.*)/i', $line, $res))
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php
Hi Chris, On 19 March 2012 17:30, Christopher Jones wrote: > Hi Mike, > > Can you update (or get updated) http://qa.php.net/phpt_details.php > with this feature? Thanks again for the heads up! Could you please also reveal how to get there from the homepage? I'm just curious... ;) -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit php-src.git: UPGRADING
Commit: 867d980574ec8086cc40634fbd62af257504b8ea Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 Parents: f5f5ca5d77cfe47b9556b3cc37fbf9605b822e5c Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=867d980574ec8086cc40634fbd62af257504b8ea Log: add note about corrected tiger hash output Changed paths: M UPGRADING Diff: 867d980574ec8086cc40634fbd62af257504b8ea diff --git a/UPGRADING b/UPGRADING index bbc5478..d92e057 100755 --- a/UPGRADING +++ b/UPGRADING @@ -467,6 +467,10 @@ b. Extensions with changed behavior is set with date.timezone and/or date_default_timezone_set(). Instead it will always fall back to "UTC". + - Hash extension + - the output of the tiger hash family has been corrected, see + https://bugs.php.net/61307 + === 10. Changes in SAPI support === -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] branch php-src.git: update branch PHP-5.4
Branch PHP-5.4 in php-src.git was updated Date: Mon, 19 Mar 2012 19:33:47 + Link: http://git.php.net/?p=php-src.git;a=log;h=867d980574ec8086cc40634fbd62af257504b8ea;hp=f5f5ca5d77cfe47b9556b3cc37fbf9605b822e5c Log: Commit: 867d980574ec8086cc40634fbd62af257504b8ea Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=867d980574ec8086cc40634fbd62af257504b8ea Shortlog: add note about corrected tiger hash output -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] [git] commit php-src.git: UPGRADING
Shouldn't the commit mails reference the push mail? Looks a bit messy without relations of commit/push mails. On 19 March 2012 20:33, Michael Wallner wrote: > Commit: 867d980574ec8086cc40634fbd62af257504b8ea > Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 > Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 20:15:54 +0100 > Parents: f5f5ca5d77cfe47b9556b3cc37fbf9605b822e5c > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=867d980574ec8086cc40634fbd62af257504b8ea > > Log: > add note about corrected tiger hash output > > Changed paths: > M UPGRADING > > > Diff: > 867d980574ec8086cc40634fbd62af257504b8ea > diff --git a/UPGRADING b/UPGRADING > index bbc5478..d92e057 100755 > --- a/UPGRADING > +++ b/UPGRADING > @@ -467,6 +467,10 @@ b. Extensions with changed behavior > is set with date.timezone and/or date_default_timezone_set(). > Instead it will always fall back to "UTC". > > + - Hash extension > + - the output of the tiger hash family has been corrected, see > + https://bugs.php.net/61307 > + > === > 10. Changes in SAPI support > === > > > -- > 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] [git] branch php-src.git: update branch master
Branch master in php-src.git was updated Date: Mon, 19 Mar 2012 21:04:42 + Link: http://git.php.net/?p=php-src.git;a=log;h=3930e1e992247c0e0cb61f3207344889ea069da4;hp=4b6d10a06ac2f01c4b4229f03b7bb11d7e530437 Log: Commit: 3930e1e992247c0e0cb61f3207344889ea069da4 Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:52:55 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:52:55 +0100 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3930e1e992247c0e0cb61f3207344889ea069da4 Shortlog: Merge branch 'PHP-5.4' Commit: 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Shortlog: fix tests failing due to corrected hash tiger -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] branch php-src.git: update branch PHP-5.4
Branch PHP-5.4 in php-src.git was updated Date: Mon, 19 Mar 2012 21:04:42 + Link: http://git.php.net/?p=php-src.git;a=log;h=260e77709ddfe9e72e2b7f11393673b6ee18a7f9;hp=867d980574ec8086cc40634fbd62af257504b8ea Log: Commit: 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Shortlog: fix tests failing due to corrected hash tiger -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit php-src.git:
Commit: 3930e1e992247c0e0cb61f3207344889ea069da4 Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:52:55 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:52:55 +0100 Parents: 4b6d10a06ac2f01c4b4229f03b7bb11d7e530437 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3930e1e992247c0e0cb61f3207344889ea069da4 Log: Merge branch 'PHP-5.4' * PHP-5.4: fix tests failing due to corrected hash tiger Changed paths: Diff: 3930e1e992247c0e0cb61f3207344889ea069da4 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit php-src.git: ext/hash/tests/mhash_001.phpt ext/hash/tests/mhash_003.phpt
Commit: 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 Parents: 867d980574ec8086cc40634fbd62af257504b8ea Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=260e77709ddfe9e72e2b7f11393673b6ee18a7f9 Log: fix tests failing due to corrected hash tiger mhash_00{1,3}.phpt were failing because of the corrected hash tiger byte output order fixes bug #60922: tests fail for mhash() and mhash_keygen_s2k() functions and MHASH_TIGER Bugs: https://bugs.php.net/60922 Changed paths: M ext/hash/tests/mhash_001.phpt M ext/hash/tests/mhash_003.phpt Diff: 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 diff --git a/ext/hash/tests/mhash_001.phpt b/ext/hash/tests/mhash_001.phpt index 5df0378..e8aac9b 100644 --- a/ext/hash/tests/mhash_001.phpt +++ b/ext/hash/tests/mhash_001.phpt @@ -16,7 +16,7 @@ $supported_hash_al = array( "MHASH_HAVAL160" => "c6b36f87750b18576981bc17b4f22271947bf9cb", "MHASH_RIPEMD160" => "6c47435aa1d359c4b7c6af46349f0c3e1258583d", "MHASH_GOST" => "101b0a2552cebdf5137cadf15147f21e55b6432935bb9c2c03c7e28d188b2d9e", -"MHASH_TIGER" => "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39", +"MHASH_TIGER" => "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d", "MHASH_CRC32" => "83041db8", "MHASH_CRC32B"=> "df5ab7a4" ); diff --git a/ext/hash/tests/mhash_003.phpt b/ext/hash/tests/mhash_003.phpt index 7dcf247..38d1a8b 100644 --- a/ext/hash/tests/mhash_003.phpt +++ b/ext/hash/tests/mhash_003.phpt @@ -16,7 +16,7 @@ $supported_hash_al = array( "MHASH_HAVAL160" => "d6e5f0ef07f3facced646eedb6364758ecde6dc6fb061e00a496f5ceb723f78ea135884d9682226ded69c11d8431240ef97cad583c4f29593bbf3dd3cab0b8792eb3d86022ca6002ebd0d9b4429909d4af85bed2b5a96b3e47b9b8cac919c1177ec40d7e", "MHASH_RIPEMD160" => "e4d5db469af29f78e2b90dc735c9cf020a1d5b19a6674458677794d4dca144d426c562aff98d8e866a8a924299ebf6b0ea9a1637f987a1fb5de9b647edc35b1447605e1babc3084be7a003931117eb33432d4142e225df044b033f3ff64bb4a18682a4f9", "MHASH_GOST" => "c044f669bd7e8643953d77c682fd179242d9df157dadf873be4d9601e4647c018234689359e7220ab0492a6240d184c478634073dea87f79be7f86fd4e2564f7d709b68a46440a121250e00fc7d57d45a9c07ee23a704ff4148c0dad7077ec527b194d87", -"MHASH_TIGER" => "67eac97b9dca0a47b1f6262f330264e4ce1c233760fe3255f642512fd3127929baccf1e758236b2768a4c2c0c06e118b19e40e2f04a5f745820fb8a99bdbc00698702a4d3120171856c4c94bda79ba1b4f60d509d7f8954da818a29797368dd47c1122aa", +"MHASH_TIGER" => "470aca9d7bc9ea67e46402332f26f6b15532fe6037231cce297912d32f5142f6276b2358e7f1ccba8b116ec0c0c2a46845f7a5042f0ee41906c0db9ba9b80f82181720314d2a70981bba79da4bc9c4564d95f8d709d5604fd48d369797a218a862196f48", "MHASH_CRC32" => "481c40148c26185f9a59ef18e86f51c5d2d0315b46711d22ae08c1ccdd669fe956c817380815e3a545f6ee453c9da48d1d994dbc3ac8ba85a572108412f06b2a16b1489cda75b118e82f7d9bdfdb68336957bbf19e4a3f76750d6985a53dd557229dfcf3", "MHASH_CRC32B" => "65ab6cb5fb7d3ea67f5da92a9bd746b6628a13368fcbcd43af49092e9c6a960fd030a5ce3c1f0ddb512ec698be96e77969748db66278b0fd837d24d8c898f50bd70993b48cc8accf4b44c54431e91385ddf04c7560a1a7368fc9e6f763457c90b07f04f1" ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] [git] commit php-src.git: ext/hash/tests/mhash_001.phpt ext/hash/tests/mhash_003.phpt
Should the commit to bugs.php.net hook already work? A link was obviously added to the commit message, but the bug was not commented. Just in case... On 19 March 2012 22:04, Michael Wallner wrote: > Commit: 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 > Author: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 > Committer: Michael Wallner(m...@php.net) Mon, 19 Mar 2012 21:49:47 +0100 > Parents: 867d980574ec8086cc40634fbd62af257504b8ea > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=260e77709ddfe9e72e2b7f11393673b6ee18a7f9 > > Log: > fix tests failing due to corrected hash tiger > > mhash_00{1,3}.phpt were failing because of the corrected hash tiger byte > output order > > fixes bug #60922: > tests fail for mhash() and mhash_keygen_s2k() functions and MHASH_TIGER > > Bugs: > https://bugs.php.net/60922 > > Changed paths: > M ext/hash/tests/mhash_001.phpt > M ext/hash/tests/mhash_003.phpt > > > Diff: > 260e77709ddfe9e72e2b7f11393673b6ee18a7f9 > diff --git a/ext/hash/tests/mhash_001.phpt b/ext/hash/tests/mhash_001.phpt > index 5df0378..e8aac9b 100644 > --- a/ext/hash/tests/mhash_001.phpt > +++ b/ext/hash/tests/mhash_001.phpt > @@ -16,7 +16,7 @@ $supported_hash_al = array( > "MHASH_HAVAL160" => "c6b36f87750b18576981bc17b4f22271947bf9cb", > "MHASH_RIPEMD160" => "6c47435aa1d359c4b7c6af46349f0c3e1258583d", > "MHASH_GOST" => > "101b0a2552cebdf5137cadf15147f21e55b6432935bb9c2c03c7e28d188b2d9e", > -"MHASH_TIGER" => "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39", > +"MHASH_TIGER" => "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d", > "MHASH_CRC32" => "83041db8", > "MHASH_CRC32B" => "df5ab7a4" > ); > diff --git a/ext/hash/tests/mhash_003.phpt b/ext/hash/tests/mhash_003.phpt > index 7dcf247..38d1a8b 100644 > --- a/ext/hash/tests/mhash_003.phpt > +++ b/ext/hash/tests/mhash_003.phpt > @@ -16,7 +16,7 @@ $supported_hash_al = array( > "MHASH_HAVAL160" => > "d6e5f0ef07f3facced646eedb6364758ecde6dc6fb061e00a496f5ceb723f78ea135884d9682226ded69c11d8431240ef97cad583c4f29593bbf3dd3cab0b8792eb3d86022ca6002ebd0d9b4429909d4af85bed2b5a96b3e47b9b8cac919c1177ec40d7e", > "MHASH_RIPEMD160" => > "e4d5db469af29f78e2b90dc735c9cf020a1d5b19a6674458677794d4dca144d426c562aff98d8e866a8a924299ebf6b0ea9a1637f987a1fb5de9b647edc35b1447605e1babc3084be7a003931117eb33432d4142e225df044b033f3ff64bb4a18682a4f9", > "MHASH_GOST" => > "c044f669bd7e8643953d77c682fd179242d9df157dadf873be4d9601e4647c018234689359e7220ab0492a6240d184c478634073dea87f79be7f86fd4e2564f7d709b68a46440a121250e00fc7d57d45a9c07ee23a704ff4148c0dad7077ec527b194d87", > -"MHASH_TIGER" => > "67eac97b9dca0a47b1f6262f330264e4ce1c233760fe3255f642512fd3127929baccf1e758236b2768a4c2c0c06e118b19e40e2f04a5f745820fb8a99bdbc00698702a4d3120171856c4c94bda79ba1b4f60d509d7f8954da818a29797368dd47c1122aa", > +"MHASH_TIGER" => > "470aca9d7bc9ea67e46402332f26f6b15532fe6037231cce297912d32f5142f6276b2358e7f1ccba8b116ec0c0c2a46845f7a5042f0ee41906c0db9ba9b80f82181720314d2a70981bba79da4bc9c4564d95f8d709d5604fd48d369797a218a862196f48", > "MHASH_CRC32" => > "481c40148c26185f9a59ef18e86f51c5d2d0315b46711d22ae08c1ccdd669fe956c817380815e3a545f6ee453c9da48d1d994dbc3ac8ba85a572108412f06b2a16b1489cda75b118e82f7d9bdfdb68336957bbf19e4a3f76750d6985a53dd557229dfcf3", > "MHASH_CRC32B" => > "65ab6cb5fb7d3ea67f5da92a9bd746b6628a13368fcbcd43af49092e9c6a960fd030a5ce3c1f0ddb512ec698be96e77969748db66278b0fd837d24d8c898f50bd70993b48cc8accf4b44c54431e91385ddf04c7560a1a7368fc9e6f763457c90b07f04f1" > ); > > > -- > 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
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php
On 19 March 2012 20:15, Christopher Jones wrote: >>> Hi Mike, >>> >>> Can you update (or get updated) http://qa.php.net/phpt_details.php >>> with this feature? Here we go: https://github.com/php/web-qa/pull/3 > > It's way too buried for my liking, but the path is: > > http://qa.php.net/ > http://qa.php.net/howtohelp.php > http://qa.php.net/write-test.php > > Then down in the "PHPT structure details" section is a link title "here" to > http://qa.php.net/phpt_details.php Jeez! -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fix NEWS: NEWS
Looks like the commit/mail script still does some superfluous html entitiy encoding: On 22 March 2012 16:40, Johannes Schlüter wrote: > Commit: 1a0b0ead145deb150f9efb6004534018b5af3a35 > Author: Johannes Schlüter Thu, 22 Mar > 2012 16:40:13 +0100 > Parents: b4aea52682a6e7a8f0e2a7638ba37145cb6bf16d > Branches: PHP-5.3 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fixed bug #61820: ext/zlib/tests/bug61820.phpt ext/zlib/zlib.c
Commit:df00b64cb93dafbe5ae47bf733e826b54b32ae37 Author:Michael Wallner Tue, 24 Apr 2012 19:50:00 +0200 Parents: f21376d6688ef51d6d6764016f8a4c2e2fd57549 Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=df00b64cb93dafbe5ae47bf733e826b54b32ae37 Log: fixed bug #61820 using ob_gzhandler will complain about headers already sent when no compression the Vary header should only be sent on the PHP_OUTPUT_HANDLER_START event Bugs: https://bugs.php.net/61820 Changed paths: A ext/zlib/tests/bug61820.phpt M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/tests/bug61820.phpt b/ext/zlib/tests/bug61820.phpt new file mode 100644 index 000..6f33b54 --- /dev/null +++ b/ext/zlib/tests/bug61820.phpt @@ -0,0 +1,23 @@ +--TEST-- +bug #61820 using ob_gzhandler will complain about headers already sent when no compression +--SKIPIF-- + +--FILE-- + +DONE +--EXPECT-- +Hi there. +This is confusing... +DONE diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d472573..545979d 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -187,7 +187,9 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o -Vary: $ HTTP_ACCEPT_ENCODING=gzip ./sapi/cgi/php <<<'op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) { + if ((output_context->op & PHP_OUTPUT_HANDLER_START) + && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) + ) { sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); } return FAILURE; -- 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': ext/zlib/zlib.c
Commit:342b641a93355e9debea263b66accd5726d8ae04 Author:Michael Wallner Tue, 24 Apr 2012 19:52:45 +0200 Parents: 117207121cd8e98549fb260a9e1ba142f31c7d42 df00b64cb93dafbe5ae47bf733e826b54b32ae37 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=342b641a93355e9debea263b66accd5726d8ae04 Log: Merge branch 'PHP-5.4' Changed paths: MM ext/zlib/zlib.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #61443: ext/zlib/tests/bug61443.phpt ext/zlib/zlib.c
Commit:7c93a16477d7e4d6e0386d0613558360f036d57b Author:Michael Wallner Tue, 24 Apr 2012 20:35:49 +0200 Parents: df00b64cb93dafbe5ae47bf733e826b54b32ae37 Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c93a16477d7e4d6e0386d0613558360f036d57b Log: fix bug #61443 Since upgrade to PHP 5.4, we can't change zlib.output_compression on the fly the check for PHP_OUTPUT_WRITTEN was over-zealous Bugs: https://bugs.php.net/61443 Changed paths: A ext/zlib/tests/bug61443.phpt M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/tests/bug61443.phpt b/ext/zlib/tests/bug61443.phpt new file mode 100644 index 000..ea2fa68 --- /dev/null +++ b/ext/zlib/tests/bug61443.phpt @@ -0,0 +1,15 @@ +--TEST-- +bug #61443 +--SKIPIF-- + +--FILE-- + +DONE +--EXPECTF-- +end +DONE diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 545979d..f157821 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -884,9 +884,6 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression) if (status & PHP_OUTPUT_SENT) { php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent"); return FAILURE; - } else if ((status & PHP_OUTPUT_WRITTEN) && int_value) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot enable zlib.output_compression - there has already been output"); - return FAILURE; } } -- 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': ext/zlib/zlib.c
Commit:a9836496e3abdcd3f6069f2d525e1e5c98b303c9 Author:Michael Wallner Tue, 24 Apr 2012 20:37:29 +0200 Parents: 342b641a93355e9debea263b66accd5726d8ae04 7c93a16477d7e4d6e0386d0613558360f036d57b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9836496e3abdcd3f6069f2d525e1e5c98b303c9 Log: Merge branch 'PHP-5.4' Changed paths: MM ext/zlib/zlib.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: BFN: NEWS
Commit:52cb8ed314d5f4476547c6c7955ca96de900333a Author:Michael Wallner Tue, 24 Apr 2012 20:40:19 +0200 Parents: 7c93a16477d7e4d6e0386d0613558360f036d57b Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=52cb8ed314d5f4476547c6c7955ca96de900333a Log: BFN Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 3a4bc9a..94971ac 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ PHP NEWS . "Connection: close" instead of "Connection: closed" (Gustavo) - Core: + . Fixed bug #61820 (using ob_gzhandler will complain about headers already +sent when no compression). (Mike) . Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash). (Laruence) . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown @@ -20,6 +22,7 @@ PHP NEWS . Fixed bug #61650 (ini parser crashes when using ${} ini variables (without apache2)). (Laruence) . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence) + . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike) . Fixed bug #61374 (html_entity_decode tries to decode code points that don't exist in ISO-8859-1). (Gustavo) . Fixed bug #61273 (call_user_func_array with more than 16333 arguments -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix NEWS order: NEWS
Commit:ac4d53cf70c3e50970a339b0920973aa0560b8ec Author:Michael Wallner Tue, 24 Apr 2012 21:22:19 +0200 Parents: 52cb8ed314d5f4476547c6c7955ca96de900333a Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ac4d53cf70c3e50970a339b0920973aa0560b8ec Log: fix NEWS order Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 94971ac..e314f26 100644 --- a/NEWS +++ b/NEWS @@ -12,8 +12,6 @@ PHP NEWS . "Connection: close" instead of "Connection: closed" (Gustavo) - Core: - . Fixed bug #61820 (using ob_gzhandler will complain about headers already -sent when no compression). (Mike) . Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash). (Laruence) . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown @@ -22,7 +20,6 @@ PHP NEWS . Fixed bug #61650 (ini parser crashes when using ${} ini variables (without apache2)). (Laruence) . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence) - . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike) . Fixed bug #61374 (html_entity_decode tries to decode code points that don't exist in ISO-8859-1). (Gustavo) . Fixed bug #61273 (call_user_func_array with more than 16333 arguments @@ -149,6 +146,9 @@ PHP NEWS Popov) - Zlib: + . Fixed bug #61820 (using ob_gzhandler will complain about headers already +sent when no compression). (Mike) + . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike) . Fixed bug #61306 (initialization of global inappropriate for ZTS). (Gustavo) . Fixed bug #61287 (A particular string fails to decompress). (Mike) . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita Popov) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #60761 zlib.output_compression fails on refresh: ext/zlib/zlib.c main/output.c main/php_output.h
Commit:0ad53bfd7da12a92a46c08e3fff579a15026b88b Author:Michael Wallner Tue, 15 May 2012 09:33:07 +0200 Parents: d9788dd73f93bc492d8fd6e93051e2a5bc8bec9f Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0ad53bfd7da12a92a46c08e3fff579a15026b88b Log: fix bug #60761 zlib.output_compression fails on refresh Bugs: https://bugs.php.net/60761 Changed paths: M ext/zlib/zlib.c M main/output.c M main/php_output.h Diff: diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index f157821..c6e2e0c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -284,7 +284,8 @@ static void php_zlib_output_compression_start(TSRMLS_D) ZLIBG(output_compression) = PHP_OUTPUT_HANDLER_DEFAULT_SIZE; /* break omitted intentionally */ default: - if ((h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) && + if (php_zlib_output_encoding(TSRMLS_C) && + (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) && (SUCCESS == php_output_handler_start(h TSRMLS_CC))) { if (ZLIBG(output_handler) && *ZLIBG(output_handler)) { MAKE_STD_ZVAL(zoh); @@ -966,7 +967,6 @@ static PHP_RINIT_FUNCTION(zlib) static PHP_RSHUTDOWN_FUNCTION(zlib) { - ZLIBG(output_compression) = 0; php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); return SUCCESS; diff --git a/main/output.c b/main/output.c index 138339e..d4eaa67 100644 --- a/main/output.c +++ b/main/output.c @@ -1025,6 +1025,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl case PHP_OUTPUT_HANDLER_SUCCESS: /* no more buffered data */ handler->buffer.used = 0; + handler->flags |= PHP_OUTPUT_HANDLER_PROCESSED; break; } diff --git a/main/php_output.h b/main/php_output.h index e4ab0f9..d050a14 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -45,6 +45,7 @@ /* handler status flags */ #define PHP_OUTPUT_HANDLER_STARTED 0x1000 #define PHP_OUTPUT_HANDLER_DISABLED0x2000 +#define PHP_OUTPUT_HANDLER_PROCESSED 0x4000 /* handler op return values */ typedef enum _php_output_handler_status_t { @@ -82,7 +83,7 @@ typedef enum _php_output_handler_hook_t { } php_output_handler_hook_t; #define PHP_OUTPUT_HANDLER_INITBUF_SIZE(s) \ -( (s) ? \ +( ((s) > 1) ? \ (s) + PHP_OUTPUT_HANDLER_ALIGNTO_SIZE - ((s) % (PHP_OUTPUT_HANDLER_ALIGNTO_SIZE)) : \ PHP_OUTPUT_HANDLER_DEFAULT_SIZE \ ) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: cleanup merge: ext/zlib/zlib.c main/output.c
Commit:2d11e55b948d99be8743c5ce61a3fdc6c3b6f2a0 Author:Michael Wallner Tue, 15 May 2012 09:44:01 +0200 Parents: d03900dc92af6d47921143f226217eae3ca564b7 0ad53bfd7da12a92a46c08e3fff579a15026b88b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d11e55b948d99be8743c5ce61a3fdc6c3b6f2a0 Log: cleanup merge Changed paths: MM ext/zlib/zlib.c MM main/output.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: BFN: NEWS
Commit:956d74572aee5a9d561b3178a0ff79de3cc90c02 Author:Michael Wallner Tue, 15 May 2012 11:26:13 +0200 Parents: 38398529b814fa75cc79ee3e3de6b05171779775 Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=956d74572aee5a9d561b3178a0ff79de3cc90c02 Log: BFN Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 728c2f3..01481a3 100644 --- a/NEWS +++ b/NEWS @@ -57,6 +57,7 @@ PHP NEWS . Fixed bug #61820 (using ob_gzhandler will complain about headers already sent when no compression). (Mike) . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike) + . Fixed bug #60761 (zlib.output_compression fails on refresh). (Mike) 08 May 2012, PHP 5.4.3 -- 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': main/output.c
Commit:178e9919b2ceacfc9c0622230e77a049d3034997 Author:Michael Wallner Wed, 28 Nov 2012 10:24:42 +0100 Parents: df3e1fd48468a84f4c8fc39208ce86b97b6d be1e5b9c54629d1502afd0ca61700426192edfb1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=178e9919b2ceacfc9c0622230e77a049d3034997 Log: Merge branch 'PHP-5.4' Changed paths: MM main/output.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: BFN #61272: NEWS
Commit:be1e5b9c54629d1502afd0ca61700426192edfb1 Author:Michael Wallner Wed, 28 Nov 2012 10:23:26 +0100 Parents: 575790e8427ea09cb76aed16ff776461367f2a3b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=be1e5b9c54629d1502afd0ca61700426192edfb1 Log: BFN #61272 Bugs: https://bugs.php.net/61272 Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index d5a63c9..811ed0d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fixed bug #63468 (wrong called method as callback with inheritance). (Laruence) + . Fixed bug #61272 (ob_start callback gets passed empty string). +(Mike, casper at langemeijer dot eu) - Imap: . Fixed Bug #63126 DISABLE_AUTHENTICATOR ignores array (Remi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #61272 ob_start callback get passed empty string: main/output.c tests/output/ob_017.phpt
Commit:575790e8427ea09cb76aed16ff776461367f2a3b Author:Michael Wallner Wed, 28 Nov 2012 10:19:44 +0100 Parents: d88017e992d03dc6909b1a1c120668b90f52ae39 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=575790e8427ea09cb76aed16ff776461367f2a3b Log: fix bug #61272 ob_start callback get passed empty string Bugs: https://bugs.php.net/61272 Changed paths: M main/output.c M tests/output/ob_017.phpt Diff: diff --git a/main/output.c b/main/output.c index e100057..b835bcc 100644 --- a/main/output.c +++ b/main/output.c @@ -297,7 +297,6 @@ PHPAPI int php_output_clean(TSRMLS_D) php_output_context context; if (OG(active) && (OG(active)->flags & PHP_OUTPUT_HANDLER_CLEANABLE)) { - OG(active)->buffer.used = 0; php_output_context_init(&context, PHP_OUTPUT_HANDLER_CLEAN TSRMLS_CC); php_output_handler_op(OG(active), &context); php_output_context_dtor(&context); @@ -1226,7 +1225,6 @@ static inline int php_output_stack_pop(int flags TSRMLS_DC) /* signal that we're cleaning up */ if (flags & PHP_OUTPUT_POP_DISCARD) { context.op |= PHP_OUTPUT_HANDLER_CLEAN; - orphan->buffer.used = 0; } php_output_handler_op(orphan, &context); } diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt index 070df60..517fafe 100644 --- a/tests/output/ob_017.phpt +++ b/tests/output/ob_017.phpt @@ -27,8 +27,8 @@ Array [0] => 1: yes [1] => 4: ! -[2] => 2: +[2] => 2: no [3] => 0: yes! -[4] => 10: +[4] => 10: no ) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix generating config.nice: acinclude.m4
Commit:a8bc18420702e1b4fa524d21eae804cd6004879e Author:Michael Wallner Fri, 2 Aug 2013 13:09:06 +0200 Parents: 55d335fa9598c688dc02118bdf7bf239fdbb5c82 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a8bc18420702e1b4fa524d21eae804cd6004879e Log: fix generating config.nice Configure runs like: $./configure -C CFLAGS="-ggdb" --enable-debug --prefix=$(pwd)/usr did result in an empty config.nice * allow single dash flags like -C, -s etc. * allow passing evnironment variables as arguments Changed paths: M acinclude.m4 Diff: diff --git a/acinclude.m4 b/acinclude.m4 index 07b1f8e..fb49059 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2686,14 +2686,14 @@ EOF fi for arg in $ac_configure_args; do if test `expr -- $arg : "'.*"` = 0; then - if test `expr -- $arg : "--.*"` = 0; then -break; + if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then +continue; fi echo "'[$]arg' \\" >> $1 CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" else - if test `expr -- $arg : "'--.*"` = 0; then -break; + if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then +continue; fi echo "[$]arg \\" >> $1 CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #65391: ext/zlib/tests/bug65391.phpt ext/zlib/zlib.c
Commit:5cea7a9047ca45c99b107a89d833c2d0dbe96ec8 Author:Michael Wallner Fri, 9 Aug 2013 11:14:04 +0200 Parents: b6b425d2cf767e47e9d05fbfe1328f1485a488ef Branches: origin/master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5cea7a9047ca45c99b107a89d833c2d0dbe96ec8 Log: fix bug #65391 Unable to send vary header user-agent when ob_start('ob_gzhandler') is called Bugs: https://bugs.php.net/65391 Changed paths: A ext/zlib/tests/bug65391.phpt M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt new file mode 100644 index 000..439473f --- /dev/null +++ b/ext/zlib/tests/bug65391.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) +--SKIPIF-- + +--GET-- +dummy=1 +--FILE-- + +Done +--EXPECTF-- +Array +( +[0] => X-Powered-By: PHP/%s +[1] => Vary: Cookie +[2] => Vary: Accept-Encoding +) +Done diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1a202e3..1114bc8 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -190,7 +190,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if ((output_context->op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC); break; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #65391: ext/zlib/tests/bug65391.phpt ext/zlib/zlib.c
Commit:5cea7a9047ca45c99b107a89d833c2d0dbe96ec8 Author:Michael Wallner Fri, 9 Aug 2013 11:14:04 +0200 Parents: b6b425d2cf767e47e9d05fbfe1328f1485a488ef Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5cea7a9047ca45c99b107a89d833c2d0dbe96ec8 Log: fix bug #65391 Unable to send vary header user-agent when ob_start('ob_gzhandler') is called Bugs: https://bugs.php.net/65391 Changed paths: A ext/zlib/tests/bug65391.phpt M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt new file mode 100644 index 000..439473f --- /dev/null +++ b/ext/zlib/tests/bug65391.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) +--SKIPIF-- + +--GET-- +dummy=1 +--FILE-- + +Done +--EXPECTF-- +Array +( +[0] => X-Powered-By: PHP/%s +[1] => Vary: Cookie +[2] => Vary: Accept-Encoding +) +Done diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1a202e3..1114bc8 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -190,7 +190,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if ((output_context->op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC); break; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] branch php-src: origin/master deleted
Deleted branch: origin/master User: Michael Wallner Fri, 09 Aug 2013 09:33:11 + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #65391: NEWS ext/zlib/tests/bug65391.phpt ext/zlib/zlib.c
Commit:ac28283beb58b367ef1f842b5ee0d6397eb4b516 Author:Michael Wallner Fri, 9 Aug 2013 11:14:04 +0200 Parents: fc7fe62e3bef50c6c56e30b9a48227f6a4203523 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ac28283beb58b367ef1f842b5ee0d6397eb4b516 Log: fix bug #65391 Unable to send vary header user-agent when ob_start('ob_gzhandler') is called Bugs: https://bugs.php.net/65391 Changed paths: M NEWS A ext/zlib/tests/bug65391.phpt M ext/zlib/zlib.c Diff: diff --git a/NEWS b/NEWS index 1b91fc7..76ec38e 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,10 @@ PHP NEWS . Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update() /pg_delete()/pg_insert()). (Yasuo) +- Zlib: + . Fixed bug #65391 (Unable to send vary header user-agent when +ob_start('ob_gzhandler') is called) (Mike) + ?? ??? 2013, PHP 5.4.18 - Core: diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt new file mode 100644 index 000..3ba5350 --- /dev/null +++ b/ext/zlib/tests/bug65391.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) +--SKIPIF-- + +--GET-- +dummy=1 +--FILE-- + +Done +--EXPECTF-- +Array +( +[0] => X-Powered-By: PHP/%s +[1] => Vary: Cookie +[2] => Vary: Accept-Encoding +) +Done + diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1a202e3..1114bc8 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -190,7 +190,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if ((output_context->op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC); break; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fixed Bug #65315 session.hash_function silently fallback to default md5: NEWS ext/session/session.c ext/session/tests/session_hash_function_basic.phpt
On 9 August 2013 11:05, Yasuo Ohgaki wrote: > Commit:b6b425d2cf767e47e9d05fbfe1328f1485a488ef > Author:Yasuo Ohgaki Fri, 9 Aug 2013 18:05:07 > +0900 > Parents: c53b425763d4cdbc9dc5708e22c6517dfd5e1e09 > Branches: master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=b6b425d2cf767e47e9d05fbfe1328f1485a488ef > > Log: > Fixed Bug #65315 session.hash_function silently fallback to default md5 > > Bugs: > https://bugs.php.net/65315 > > Changed paths: > M NEWS > M ext/session/session.c > A ext/session/tests/session_hash_function_basic.phpt Hey Yasuo! > + php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration > 'session.hash_function' must be existing hash function. %s does not exist.", > new_value); This message differs from your test: > +Warning: ini_set(): session.hash_func must be existing hash function. none > does not exist. in %s/session_hash_function_basic.php on line 17 > +bool(false) > +bool(true) > +bool(true) > +string(40) "%s" > +bool(true) > +Done > > > -- > 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: Merge branch '2Guploads': configure.in ext/hash/config.m4 ext/mysqlnd/config9.m4
Commit:611122c22ea809a128e2cbb07e0160e141ac492d Author:Michael Wallner Fri, 9 Aug 2013 11:47:25 +0200 Parents: 5acdcbc0bc49767cd76b1ba4c1cf34814ccffdc9 4a9d7c1f001a558ab0ebddb74e3b81d8d58b8095 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=611122c22ea809a128e2cbb07e0160e141ac492d Log: Merge branch '2Guploads' * 2Guploads: 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. unify stdint type usage Changed paths: MM configure.in MM ext/hash/config.m4 MM ext/mysqlnd/config9.m4 Diff: -- 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:de3527002ae7e81d78cf535d810724b790cd5765 Author:Ralf Lang Fri, 28 Jun 2013 08:38:34 +0200 Committer: Michael Wallner Tue, 6 Aug 2013 22:51:57 +0200 Parents: 84f9213e00ae624e789ec0ed8f023c22a557d215 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de3527002ae7e81d78cf535d810724b790cd5765 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:4a9d7c1f001a558ab0ebddb74e3b81d8d58b8095 Author:Michael Wallner Mon, 5 Aug 2013 13:53:35 +0200 Parents: 8a7ea474a4f8d8e61e0ed9d82cf764eb6b13f580 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4a9d7c1f001a558ab0ebddb74e3b81d8d58b8095 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..fe13d90 --- /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: more precise condition: main/rfc1867.c
Commit:8a7ea474a4f8d8e61e0ed9d82cf764eb6b13f580 Author:Ralf Lang Tue, 23 Jul 2013 07:39:36 +0200 Committer: Michael Wallner Tue, 6 Aug 2013 22:51:58 +0200 Parents: 679fa1fc6854dce7d5d0ff7def65a5bbdbb18094 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8a7ea474a4f8d8e61e0ed9d82cf764eb6b13f580 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: make this work in vc11 too: main/SAPI.h main/rfc1867.c
Commit:679fa1fc6854dce7d5d0ff7def65a5bbdbb18094 Author:Ralf Lang Mon, 22 Jul 2013 21:26:38 +0200 Committer: Michael Wallner Tue, 6 Aug 2013 22:51:58 +0200 Parents: cb4c195f0b85ca5d91fee1ebe90105b8bb68356c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=679fa1fc6854dce7d5d0ff7def65a5bbdbb18094 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: Use int64_t and atoll() after discussion with johannes: main/SAPI.h main/rfc1867.c
Commit:cb4c195f0b85ca5d91fee1ebe90105b8bb68356c Author:Ralf Lang Mon, 22 Jul 2013 18:03:11 +0200 Committer: Michael Wallner Tue, 6 Aug 2013 22:51:57 +0200 Parents: de3527002ae7e81d78cf535d810724b790cd5765 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb4c195f0b85ca5d91fee1ebe90105b8bb68356c 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: 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:84f9213e00ae624e789ec0ed8f023c22a557d215 Author:Ralf Lang Fri, 28 Jun 2013 08:32:10 +0200 Committer: Michael Wallner Tue, 6 Aug 2013 22:51:57 +0200 Parents: 14caf174ff219376e4f1234bd297ffe973cc416e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=84f9213e00ae624e789ec0ed8f023c22a557d215 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 4c78fca..221b002 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: unify stdint type usage: Makefile.global acinclude.m4 configure.in ext/date/config0.m4 ext/date/lib/timelib_structs.h ext/exif/exif.c ext/hash/config.m4 ext/hash/config.w32 ext/
Commit:14caf174ff219376e4f1234bd297ffe973cc416e Author:Michael Wallner Tue, 6 Aug 2013 22:45:35 +0200 Parents: ca0497bbac282c39048776a9f61052e67643 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=14caf174ff219376e4f1234bd297ffe973cc416e Log: unify stdint type usage if you need C99 stdint types, just include "php_stdint.h" Changed paths: M Makefile.global M acinclude.m4 M configure.in M ext/date/config0.m4 M ext/date/lib/timelib_structs.h M ext/exif/exif.c M ext/hash/config.m4 M ext/hash/config.w32 M ext/hash/package.xml M ext/hash/php_hash.h D ext/hash/php_hash_types.h M ext/mysqlnd/config9.m4 M ext/mysqlnd/mysqlnd_portability.h M ext/oci8/oci8.c M ext/phar/phar_internal.h M ext/spl/php_spl.h M ext/standard/crypt_freesec.h M ext/standard/crypt_sha256.c M ext/standard/crypt_sha512.c M ext/standard/string.c M ext/zip/lib/zipconf.h M main/php.h A main/php_stdint.h M sapi/cli/php_http_parser.h diff --git a/Makefile.global b/Makefile.global index e744e37..bd82daf 100644 --- a/Makefile.global +++ b/Makefile.global @@ -120,7 +120,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h rm -f php5.spec main/build-defs.h scripts/phpize - rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/mysqlnd/php_mysqlnd_config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak + rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1 rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h diff --git a/acinclude.m4 b/acinclude.m4 index 682be59..b76bd34 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2978,3 +2978,22 @@ $ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS) EOF ]) + +dnl +dnl PHP_CHECK_STDINT_TYPES +dnl +AC_DEFUN([PHP_CHECK_STDINT_TYPES], [ + AC_CHECK_SIZEOF([short], 2) + AC_CHECK_SIZEOF([int], 4) + AC_CHECK_SIZEOF([long], 4) + AC_CHECK_SIZEOF([long long], 8) + AC_CHECK_TYPES([int8, int16, int32, int64, int8_t, int16_t, int32_t, int64_t, uint8, uint16, uint32, uint64, uint8_t, uint16_t, uint32_t, uint64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t], [], [], [ +#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif + ]) + AC_DEFINE([PHP_HAVE_STDINT_TYPES], [1], [Checked for stdint types]) +]) diff --git a/configure.in b/configure.in index 51beea0..cc038dd 100644 --- a/configure.in +++ b/configure.in @@ -572,6 +572,9 @@ PHP_CHECK_SIZEOF(intmax_t, 0) PHP_CHECK_SIZEOF(ssize_t, 8) PHP_CHECK_SIZEOF(ptrdiff_t, 8) +dnl Check stdint types (must be after header check) +PHP_CHECK_STDINT_TYPES + dnl Check for members of the stat structure AC_STRUCT_ST_BLKSIZE dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists diff --git a/ext/date/config0.m4 b/ext/date/config0.m4 index f403104..0b46c68 100644 --- a/ext/date/config0.m4 +++ b/ext/date/config0.m4 @@ -22,4 +22,5 @@ cat > $ext_builddir/lib/timelib_config.h < #endif +#include EOF diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h index a3d7793..5d1d963 100644 --- a/ext/date/lib/timelib_structs.h +++ b/ext/date/lib/timelib_structs.h @@ -33,11 +33,6 @@ #include #endif -#ifdef PHP_WIN32 -/* TODO: Remove these hacks/defs once we have the int definitions in main/ -rathen than in each 2nd extension and win32/ */ -# include "win32/php_stdint.h" -#else # ifndef HAVE_INT32_T # if SIZEOF_INT == 4 typedef int int32_t; @@ -53,7 +48,6 @@ typedef unsigned int uint32_t; typedef unsigned long int uint32_t; # endif # endif -#endif #include @@ -68,8 +62,8 @@ typedef unsigned long int uint32_t; #endif #if defined(_MSC_VER) -typedef uint64_t timelib_ull; -typedef int64_t timelib_sll; +typedef __uint64 timelib_ull; +typedef __int64 timelib_sll; # define TIMELIB_LL_CONST(n) n ## i64 #else typedef unsigned long long timelib_ull; diff --git a/ext/exif/exif.c b/ext
[PHP-CVS] com php-src: fix test: ext/session/tests/session_hash_function_basic.phpt
Commit:7c3afd31f9a3357afc93c50223e2c4cfb1520f37 Author:Michael Wallner Fri, 9 Aug 2013 13:30:29 +0200 Parents: 611122c22ea809a128e2cbb07e0160e141ac492d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c3afd31f9a3357afc93c50223e2c4cfb1520f37 Log: fix test Changed paths: M ext/session/tests/session_hash_function_basic.phpt Diff: diff --git a/ext/session/tests/session_hash_function_basic.phpt b/ext/session/tests/session_hash_function_basic.phpt index 8b14a88..45b8bc0 100644 --- a/ext/session/tests/session_hash_function_basic.phpt +++ b/ext/session/tests/session_hash_function_basic.phpt @@ -41,7 +41,7 @@ bool(true) string(40) "%s" bool(true) -Warning: ini_set(): session.hash_func must be existing hash function. none does not exist. in %s/session_hash_function_basic.php on line 17 +Warning: ini_set(): session.configuration 'session.hash_function' must be existing hash function. none does not exist. in %s/session_hash_function_basic.php on line 17 bool(false) bool(true) bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add upgrading notes about bison and 2Guploads: UPGRADING UPGRADING.INTERNALS
Commit:867b6c05e7b37ab7b229de13b39f4f23c4d178dc Author:Michael Wallner Fri, 9 Aug 2013 21:16:47 +0200 Parents: 2bc886abed2164fd30519b3016e3565d6069f71f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=867b6c05e7b37ab7b229de13b39f4f23c4d178dc Log: add upgrading notes about bison and 2Guploads Changed paths: M UPGRADING M UPGRADING.INTERNALS Diff: diff --git a/UPGRADING b/UPGRADING index 45e47ff..431ad79 100755 --- a/UPGRADING +++ b/UPGRADING @@ -93,3 +93,5 @@ PHP X.Y UPGRADE NOTES 11. Other Changes +- File upload: + Uploads equal or greater than 2GB in size are now accepted. diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index cfc19d5..566f310 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -48,7 +48,9 @@ UPGRADE NOTES - PHP X.Y a. Unix build system changes -- +- The bison version check is now a blacklist instead of a whitelist. +- The bison binary can be specified through the YACC environment/configure + variable. Previously `bison` was assumed to be in $PATH. b. Windows 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: haha, a bit too optimistic; not merged yet: UPGRADING.INTERNALS
Commit:2d403f0c1d9632651d4c1516102afb1ffef67e2e Author:Michael Wallner Fri, 9 Aug 2013 21:33:48 +0200 Parents: 867b6c05e7b37ab7b229de13b39f4f23c4d178dc Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d403f0c1d9632651d4c1516102afb1ffef67e2e Log: haha, a bit too optimistic; not merged yet Changed paths: M UPGRADING.INTERNALS Diff: diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 566f310..e81291c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -48,9 +48,6 @@ UPGRADE NOTES - PHP X.Y a. Unix build system changes -- The bison version check is now a blacklist instead of a whitelist. -- The bison binary can be specified through the YACC environment/configure - variable. Previously `bison` was assumed to be in $PATH. b. Windows build system changes - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [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
On 10 August 2013 01:28, Yasuo Ohgaki wrote: > Hi Mike, > > I got test failures on session module. I guess it's related to your change. > Could you take a look? > > session rfc1867 [ext/session/tests/rfc1867.phpt] > session rfc1867 [ext/session/tests/rfc1867_cleanup.phpt] > session rfc1867 disabled [ext/session/tests/rfc1867_disabled.phpt] > session rfc1867 disabled 2 [ext/session/tests/rfc1867_disabled_2.phpt] > session rfc1867 [ext/session/tests/rfc1867_inter.phpt] > session rfc1867 no name [ext/session/tests/rfc1867_no_name.phpt] > session rfc1867 sid cookie [ext/session/tests/rfc1867_sid_cookie.phpt] > session rfc1867 sid get [ext/session/tests/rfc1867_sid_get.phpt] > session rfc1867 sid get 2 [ext/session/tests/rfc1867_sid_get_2.phpt] > session rfc1867 sid cookie [ext/session/tests/rfc1867_sid_invalid.phpt] > session rfc1867 sid only cookie > [ext/session/tests/rfc1867_sid_only_cookie.phpt] > session rfc1867 sid only cookie 2 > [ext/session/tests/rfc1867_sid_only_cookie_2.phpt] > session rfc1867 sid post [ext/session/tests/rfc1867_sid_post.phpt] Session tests are fine for me. PASS session rfc1867 [ext/session/tests/rfc1867.phpt] PASS session rfc1867 [ext/session/tests/rfc1867_cleanup.phpt] PASS session rfc1867 disabled [ext/session/tests/rfc1867_disabled.phpt] PASS session rfc1867 disabled 2 [ext/session/tests/rfc1867_disabled_2.phpt] PASS session rfc1867 [ext/session/tests/rfc1867_inter.phpt] SKIP session rfc1867 invalid settings [ext/session/tests/rfc1867_invalid_settings-win.phpt] reason: windows only test PASS session rfc1867 invalid settings [ext/session/tests/rfc1867_invalid_settings.phpt] SKIP session rfc1867 invalid settings 2 [ext/session/tests/rfc1867_invalid_settings_2-win.phpt] reason: windows only test PASS session rfc1867 invalid settings 2 [ext/session/tests/rfc1867_invalid_settings_2.phpt] PASS session rfc1867 no name [ext/session/tests/rfc1867_no_name.phpt] PASS session rfc1867 sid cookie [ext/session/tests/rfc1867_sid_cookie.phpt] PASS session rfc1867 sid get [ext/session/tests/rfc1867_sid_get.phpt] PASS session rfc1867 sid get 2 [ext/session/tests/rfc1867_sid_get_2.phpt] PASS session rfc1867 sid cookie [ext/session/tests/rfc1867_sid_invalid.phpt] PASS session rfc1867 sid only cookie [ext/session/tests/rfc1867_sid_only_cookie.phpt] PASS session rfc1867 sid only cookie 2 [ext/session/tests/rfc1867_sid_only_cookie_2.phpt] PASS session rfc1867 sid post [ext/session/tests/rfc1867_sid_post.phpt] What's your failure? -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #65481 (shutdown segfault due to serialize): NEWS ext/standard/php_var.h ext/standard/tests/serialize/bug65481.phpt ext/standard/var_unserializer.c ext/standard/var_unse
Commit:1ac4d8f2c632f5be5a02d49c1e0d3b1fb515e4a8 Author:Michael Wallner Mon, 29 Jul 2013 17:59:35 +0200 Parents: aa7d3d8e6d8de73ebe8dd015fb5392a4bde5bfc6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1ac4d8f2c632f5be5a02d49c1e0d3b1fb515e4a8 Log: fix bug #65481 (shutdown segfault due to serialize) Bugs: https://bugs.php.net/65481 Changed paths: M NEWS M ext/standard/php_var.h A ext/standard/tests/serialize/bug65481.phpt M ext/standard/var_unserializer.c M ext/standard/var_unserializer.re diff --git a/NEWS b/NEWS index 64e049d..e56ff28 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.4.19 - Core: + . Fixed bug #65481 (shutdown segfault due to serialize) (Mike) . Fixed bug #65470 (Segmentation fault in zend_error() with --enable-dtrace). (Chris Jones) . Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 35343b3..afc5f17 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -115,6 +115,7 @@ do { \ PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval **nzval); PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval **val); +PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); #define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \ diff --git a/ext/standard/tests/serialize/bug65481.phpt b/ext/standard/tests/serialize/bug65481.phpt new file mode 100644 index 000..65634f6 --- /dev/null +++ b/ext/standard/tests/serialize/bug65481.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #65481 (shutdown segfault due to serialize) +--FILE-- +e[] = $e; + $e->e = $c->e; + } + + return serialize(array(serialize($c))); + } + + public function unserialize($str) + { + $r = unserialize($str); + $r = unserialize($r[0]); + } +} + +$token = new Token; +$token = serialize($token); + +?> +Done +--EXPECT-- +Test +Done diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index d8bae08..8a35e0a 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Mar 9 22:33:09 2013 */ +/* Generated by re2c 0.13.5 on Mon Jul 29 17:57:26 2013 */ #line 1 "ext/standard/var_unserializer.re" /* +--+ @@ -26,6 +26,7 @@ /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1024 +#define VAR_ENTRIES_DBG 0 typedef struct { zval *data[VAR_ENTRIES_MAX]; @@ -36,7 +37,7 @@ typedef struct { static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -60,7 +61,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -82,11 +83,35 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) var_hash->data[var_hash->used_slots++] = *rval; } +PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = (*var_hashx)->last_dtor; +#if VAR_ENTRIES_DBG + fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); +#endif + + if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!(*var_hashx)->first_dtor) { + (*var_hashx)->first_dtor = var_hash; + } else { + ((var_entries *) (*var_hashx)->last_dtor)->next = var_hash; + } + + (*var_hashx)->last_dtor = var_hash; + } + + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; -#if 0 +#if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/var_unserializer.c
Commit:9d2cdacf4a36045120aab049b03229bf0064df4e Author:Michael Wallner Tue, 20 Aug 2013 00:08:55 +0200 Parents: 69f12ad582c102c1d7b3b2c0ae6cf7cd633dfe1d 1ac4d8f2c632f5be5a02d49c1e0d3b1fb515e4a8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9d2cdacf4a36045120aab049b03229bf0064df4e Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: fix bug #65481 (shutdown segfault due to serialize) Conflicts: ext/standard/var_unserializer.c Bugs: https://bugs.php.net/65481 Changed paths: MM ext/standard/var_unserializer.c Diff: -- 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/pdo/pdo_sql_parser.c
Commit:7f3e7eb95812649fd421b405990a96091010b8e9 Author:Michael Wallner Tue, 20 Aug 2013 19:21:53 +0200 Parents: 4cd9796be78bfb1cc88b5ed71cbd61e56937b8e7 27c803aaed259f76a66db1278eea05f30a8ec956 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f3e7eb95812649fd421b405990a96091010b8e9 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Fix bug #64953 (Postgres prepared statement positional parameter casting) Conflicts: ext/pdo/pdo_sql_parser.c Bugs: https://bugs.php.net/64953 Changed paths: MM ext/pdo/pdo_sql_parser.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix bug #64953 (Postgres prepared statement positional parameter casting): NEWS ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re ext/pdo_pgsql/tests/bug64953.phpt
Commit:27c803aaed259f76a66db1278eea05f30a8ec956 Author:Michael Wallner Tue, 20 Aug 2013 19:19:02 +0200 Parents: d487f5e9acc55fb76d71c40e451efebbc087af35 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=27c803aaed259f76a66db1278eea05f30a8ec956 Log: Fix bug #64953 (Postgres prepared statement positional parameter casting) Bugs: https://bugs.php.net/64953 Changed paths: M NEWS M ext/pdo/pdo_sql_parser.c M ext/pdo/pdo_sql_parser.re A ext/pdo_pgsql/tests/bug64953.phpt Diff: diff --git a/NEWS b/NEWS index aeae233..1218c50 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,10 @@ PHP NEWS - SPL: . Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence) +- PDO: + . Fixed bug #64953 (Postgres prepared statement positional parameter +casting). (Mike) + - Phar: . Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for some specific contents). (Stas) diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 4c52350..1ed78c1 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Thu Apr 19 12:42:11 2012 */ +/* Generated by re2c 0.13.5 on Tue Aug 20 18:02:48 2013 */ #line 1 "ext/pdo/pdo_sql_parser.re" /* +--+ @@ -77,7 +77,7 @@ yy2: yy3: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych >= 0x01) goto yy41; + if (yych >= 0x01) goto yy43; yy4: #line 63 "ext/pdo/pdo_sql_parser.re" { SKIP_ONE(PDO_PARSER_TEXT); } @@ -86,7 +86,7 @@ yy5: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x00) goto yy4; - goto yy36; + goto yy38; yy6: yych = *++YYCURSOR; switch (yych) { @@ -153,21 +153,19 @@ yy6: case 'x': case 'y': case 'z': goto yy32; - case ':': - case '?': goto yy29; + case ':': goto yy35; default:goto yy4; } yy7: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case ':': case '?': goto yy29; default:goto yy8; } yy8: #line 62 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_BIND_POS); } -#line 171 "ext/pdo/pdo_sql_parser.c" +#line 169 "ext/pdo/pdo_sql_parser.c" yy9: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -177,7 +175,7 @@ yy9: yy10: #line 65 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 181 "ext/pdo/pdo_sql_parser.c" +#line 179 "ext/pdo/pdo_sql_parser.c" yy11: yych = *++YYCURSOR; switch (yych) { @@ -214,7 +212,7 @@ yy14: yy16: #line 64 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 218 "ext/pdo/pdo_sql_parser.c" +#line 216 "ext/pdo/pdo_sql_parser.c" yy17: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -288,14 +286,13 @@ yy29: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; switch (yych) { - case ':': case '?': goto yy29; default:goto yy31; } yy31: #line 60 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 299 "ext/pdo/pdo_sql_parser.c" +#line 296 "ext/pdo/pdo_sql_parser.c" yy32: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -369,51 +366,59 @@ yy32: yy34: #line 61 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_BIND); } -#line 373 "ext/pdo/pdo_sql_parser.c" +#line 370 "ext/pdo/pdo_sql_parser.c" yy35: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy36: switch (yych) { - case 0x00: goto yy2; - case '\'': goto yy38; - case '\\': goto yy37; - default:goto yy35; + case ':': goto yy35; + default:goto yy31; } yy37: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x00) goto yy2; - goto yy35; yy38: + switch (yych) { + case 0x00: goto yy2; + case '\'': goto yy40; + case '\\': goto yy39; + default:goto yy37; + } +yy39: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= 0x00) goto yy2; + goto yy37; +yy40: ++YYCURSOR; #line 59 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 395 "
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/info.c
Commit:618194859205c178a5359e60d8e156763036ddfd Author:Michael Wallner Wed, 21 Aug 2013 19:18:11 +0200 Parents: 83e3466898abcde99d0bd0b3dadc43b416e5cde6 d8023d13eb5c5c611a17b183b28c0a81233d8a1a Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=618194859205c178a5359e60d8e156763036ddfd Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Fix pointer sign warning showing up in EVERY build Changed paths: MM ext/standard/info.c Diff: -- 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.5': ext/standard/info.c
Commit:4abee3730f15e4103760eddb421d79001092529d Author:Michael Wallner Wed, 21 Aug 2013 19:18:29 +0200 Parents: 90b489f8261e57cf4a8e94440327f32f9e67e08b 618194859205c178a5359e60d8e156763036ddfd Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4abee3730f15e4103760eddb421d79001092529d Log: Merge branch 'PHP-5.5' * PHP-5.5: Fix pointer sign warning showing up in EVERY build Changed paths: MM ext/standard/info.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix pointer sign warning showing up in EVERY build: ext/standard/info.c
Commit:d8023d13eb5c5c611a17b183b28c0a81233d8a1a Author:Michael Wallner Wed, 21 Aug 2013 19:17:22 +0200 Parents: 540f325664a6f4975cf005f367c95ece04757714 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d8023d13eb5c5c611a17b183b28c0a81233d8a1a Log: Fix pointer sign warning showing up in EVERY build Changed paths: M ext/standard/info.c Diff: diff --git a/ext/standard/info.c b/ext/standard/info.c index 6bc406f..cb2e469 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -295,7 +295,7 @@ void php_info_print_style(TSRMLS_D) PHPAPI char *php_info_html_esc(char *string TSRMLS_DC) { size_t new_len; - return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); + return php_escape_html_entities((unsigned char *) string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix broken sha2 configure tests: ext/standard/config.m4
Commit:2e692b22e92e26f6224e313864105ad1d9c4585d Author:Michael Wallner Fri, 13 Sep 2013 12:54:42 +0200 Parents: ef9e003b0c30e704073f125632e916e927363426 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2e692b22e92e26f6224e313864105ad1d9c4585d Log: fix broken sha2 configure tests see http://patch-tracker.debian.org/patch/series/view/php5/5.5.3+dfsg-1/fix_broken_sha2_test.patch Changed paths: M ext/standard/config.m4 Diff: diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 2af2209..3d00d88 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -182,12 +182,12 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT -char salt[30], answer[80]; - -salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; +char salt[21], answer[21+86]; + +strcpy(salt,"\$6\$rasmuslerdorf\$"); strcpy(answer, salt); - strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); -exit (strcmp((char *)crypt("foo",salt),answer)); +strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/"); +exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); #else exit(0); #endif @@ -211,12 +211,13 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT -char salt[30], answer[80]; -salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0'; -strcat(salt,""); +char salt[21], answer[21+43]; + +strcpy(salt,"\$5\$rasmuslerdorf\$"); strcpy(answer, salt); -strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5"); -exit (strcmp((char *)crypt("foo",salt),answer)); +strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23"); +exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); + #else exit(0); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix broken sha2 configure tests: ext/standard/config.m4
Commit:9eaffd34c123ae5782054cd32bf6caa50ff2b7d2 Author:Michael Wallner Fri, 13 Sep 2013 12:54:42 +0200 Parents: d76959a3b976a0d9f0be994451fd7d5a6def3204 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9eaffd34c123ae5782054cd32bf6caa50ff2b7d2 Log: fix broken sha2 configure tests see http://patch-tracker.debian.org/patch/series/view/php5/5.5.3+dfsg-1/fix_broken_sha2_test.patch Changed paths: M ext/standard/config.m4 Diff: diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 2af2209..3d00d88 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -182,12 +182,12 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT -char salt[30], answer[80]; - -salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; +char salt[21], answer[21+86]; + +strcpy(salt,"\$6\$rasmuslerdorf\$"); strcpy(answer, salt); - strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); -exit (strcmp((char *)crypt("foo",salt),answer)); +strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/"); +exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); #else exit(0); #endif @@ -211,12 +211,13 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT -char salt[30], answer[80]; -salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0'; -strcat(salt,""); +char salt[21], answer[21+43]; + +strcpy(salt,"\$5\$rasmuslerdorf\$"); strcpy(answer, salt); -strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5"); -exit (strcmp((char *)crypt("foo",salt),answer)); +strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23"); +exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); + #else exit(0); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: this test is fragile on travis, let's see why: ext/standard/tests/file/disk_free_space_basic.phpt
Commit:52bd9f05ead1803e4deacb86affe3bf9ca47b68e Author:Michael Wallner Mon, 16 Sep 2013 09:29:42 +0200 Parents: 743c680545897a1d3900e8b844a4c3cca7dc30e9 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=52bd9f05ead1803e4deacb86affe3bf9ca47b68e Log: this test is fragile on travis, let's see why Changed paths: M ext/standard/tests/file/disk_free_space_basic.phpt Diff: diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index 7ea8d36..ec8a853 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -35,8 +35,10 @@ var_dump( $space2 ); if( $space1 > $space2 ) echo "\n Free Space Value Is Correct\n"; -else +else { echo "\n Free Space Value Is Incorrect\n"; + var_dump($space1, $space2); +} echo "*** Testing with Binary Input ***\n"; var_dump( disk_free_space(b"$file_path") ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: double test timeout for travis: .travis.yml
Commit:b5283b9b7abecde841eb268c4b158cd76630d53b Author:Michael Wallner Mon, 16 Sep 2013 09:35:08 +0200 Parents: 1916aaa272a19e118eae7ad53622174a3fd4a15e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b5283b9b7abecde841eb268c4b158cd76630d53b Log: double test timeout for travis Changed paths: M .travis.yml Diff: diff --git a/.travis.yml b/.travis.yml index d149772..0765304 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,4 @@ before_script: - . ./travis/ext/pdo_pgsql/setup.sh # Run PHPs run-tests.php -script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff +script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: use 65k of data to get a more explicit result: ext/standard/tests/file/disk_free_space_basic.phpt
Commit:ca3d5d06e4eea225f7da2202153d59545db0538e Author:Michael Wallner Mon, 16 Sep 2013 10:50:02 +0200 Parents: 6dff371a353545607fe03bfee8a90790a991c4cf Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ca3d5d06e4eea225f7da2202153d59545db0538e Log: use 65k of data to get a more explicit result Changed paths: M ext/standard/tests/file/disk_free_space_basic.phpt Diff: diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index ec8a853..bfa1db9 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -25,7 +25,7 @@ $space1 = disk_free_space($file_path.$dir); var_dump( $space1 ); $fh = fopen($file_path.$dir."/disk_free_space.tmp", "a"); -$data = str_repeat("x", 4096); +$data = str_repeat("x", 0x); fwrite($fh, (binary)$data); fclose($fh); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: double test timeout for travis: .travis.yml
On 16 September 2013 11:38, Nikita Popov wrote: > On Mon, Sep 16, 2013 at 9:35 AM, Michael Wallner wrote: >> >> # Run PHPs run-tests.php >> -script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g >> "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff >> +script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g >> "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 > > > Are you sure this is the right thing to do? If we have tests that run longer > than 60 seconds, we should drop those tests or make sure that they're > faster. Build times on Travis are already pretty long. Well, yes I guess. Unless you've got a better idea why this test times out :) https://travis-ci.org/php/php-src/builds/11404125 -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: upload2G note: NEWS
Commit:552f22abae0cf2dda3f72b034f656c4fef5761d2 Author:Michael Wallner Tue, 17 Sep 2013 08:04:07 +0200 Parents: ca75e6f760c399b8b4aeca0078de620835e84789 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=552f22abae0cf2dda3f72b034f656c4fef5761d2 Log: upload2G note Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 64ca9a5..60fac8c 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS . Made calls from incompatible context issue an E_DEPRECATED warning instead of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). (Gustavo) + . Uploads equal or greater than 2GB in size are now accepted. +(Ralf Lang, Mike) - cURL: . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir -- 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: 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: 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_param
[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: 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: 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: 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: 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
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: 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 +012
[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: 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: 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_param
[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; -
[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: 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
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: fix build - PRIu64 vs %I64u: main/php_variables.c
On 17 September 2013 16:02, Anatol Belski wrote: > 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 > How about adding such constants to win32/php_stdint.h instead? -- Regards, Mike -- 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
On 18 September 2013 07:45, Jacques Marneweck wrote: > Hi Michael: > > Can you fix the typo of $HTTP_ROW_POST_DATA to $HTTP_RAW_POST_DATA in the > UPGRADING > file. > Sure! Thanks for the hint.
[PHP-CVS] com php-src: fix test concurrency: ext/libxml/tests/bug61367-read.phpt ext/libxml/tests/bug61367-write.phpt
Commit:e9877fe92e8f9a0cc212362f6c35550b92036b3e Author:Michael Wallner Wed, 18 Sep 2013 10:53:11 +0200 Parents: 14d53417879256044c40b2ef8d0aa32b1f215acb Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e9877fe92e8f9a0cc212362f6c35550b92036b3e Log: fix test concurrency Changed paths: M ext/libxml/tests/bug61367-read.phpt M ext/libxml/tests/bug61367-write.phpt Diff: diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt index 75d0006..b4ecaa0 100644 --- a/ext/libxml/tests/bug61367-read.phpt +++ b/ext/libxml/tests/bug61367-read.phpt @@ -32,10 +32,10 @@ XML } } -var_dump(mkdir('test_bug_61367')); -var_dump(mkdir('test_bug_61367/base')); -var_dump(file_put_contents('test_bug_61367/bad', 'blah')); -var_dump(chdir('test_bug_61367/base')); +var_dump(mkdir('test_bug_61367-read')); +var_dump(mkdir('test_bug_61367-read/base')); +var_dump(file_put_contents('test_bug_61367-read/bad', 'blah')); +var_dump(chdir('test_bug_61367-read/base')); stream_wrapper_register( 'exploit', 'StreamExploiter' ); $s = fopen( 'exploit://', 'r' ); @@ -43,9 +43,9 @@ $s = fopen( 'exploit://', 'r' ); ?> --CLEAN-- --EXPECTF-- bool(true) @@ -53,7 +53,7 @@ bool(true) int(4) bool(true) -Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "file:///%s/test_bug_61367/bad" in %s on line %d +Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "file:///%s/test_bug_61367-read/bad" in %s on line %d Warning: DOMDocument::loadXML(): Failure to process entity file in Entity, line: 4 in %s on line %d diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt index e18b071..63e99a8 100644 --- a/ext/libxml/tests/bug61367-write.phpt +++ b/ext/libxml/tests/bug61367-write.phpt @@ -19,10 +19,10 @@ class StreamExploiter { } } -var_dump(mkdir('test_bug_61367')); -var_dump(mkdir('test_bug_61367/base')); -var_dump(file_put_contents('test_bug_61367/bad', 'blah')); -var_dump(chdir('test_bug_61367/base')); +var_dump(mkdir('test_bug_61367-write')); +var_dump(mkdir('test_bug_61367-write/base')); +var_dump(file_put_contents('test_bug_61367-write/bad', 'blah')); +var_dump(chdir('test_bug_61367-write/base')); stream_wrapper_register( 'exploit', 'StreamExploiter' ); $s = fopen( 'exploit://', 'r' ); @@ -30,9 +30,9 @@ $s = fopen( 'exploit://', 'r' ); ?> --CLEAN-- --EXPECTF-- bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test concurrency: ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt ext/spl/tests/RecursiveDirectoryIte
Commit:6866b45a48a773f434c04828c9d0a05ae9d9cf3f Author:Michael Wallner Wed, 18 Sep 2013 10:52:35 +0200 Parents: 002763fb7b603b30fab3955c0acd132298926c1b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6866b45a48a773f434c04828c9d0a05ae9d9cf3f Log: fix test concurrency Changed paths: M ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt M ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt M ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt M ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt M ext/spl/tests/SplFileObject_fgetcsv_basic.phpt M ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt M ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt M ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt M ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt M ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt M ext/spl/tests/SplFileObject_fgetcsv_escape_default.phpt M ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt M ext/spl/tests/SplFileObject_fputcsv_002.phpt M ext/spl/tests/SplFileObject_fputcsv_error.phpt M ext/spl/tests/dit_006.phpt diff --git a/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt b/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt index ed1f473..d4f22f6 100644 --- a/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt +++ b/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt @@ -4,7 +4,7 @@ DirectoryIterator::getBasename() - Basic Test PHPNW Testfest 2009 - Adrian Hardy --FILE-- --CLEAN-- diff --git a/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt b/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt index b2df8a5..ef13520 100644 --- a/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt +++ b/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt @@ -4,7 +4,7 @@ DirectoryIterator::getBasename() - Pass unexpected array PHPNW Testfest 2009 - Adrian Hardy --FILE-- --CLEAN-- diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt index f0b2b01..f6bc266 100644 --- a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt @@ -5,7 +5,7 @@ Pawel Krynicki #testfest AmsterdamPHP 2012-06-23 --FILE-- diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt index 7b12672..6527d84 100644 --- a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt @@ -5,7 +5,7 @@ Pawel Krynicki #testfest AmsterdamPHP 2012-06-23 --FILE-- --EXPECTF-- diff --git a/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt index abfe5f2..84b5403 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv default path --FILE-- fgetcsv()); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt index 4402d6c..a8125a0 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv('|')); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt index 64d6514..169ded7 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv('invalid')); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::fgetcsv(): delimiter must be a character in %s on line %d diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt index efbb5fb..efe765c 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv(',', '"')); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt index 7487b83..f8c14f0 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative de
[PHP-CVS] com php-src: fix test concurrency: ext/phar/tests/031.phpt ext/phar/tests/032.phpt ext/phar/tests/files/phar_oo_test.inc ext/phar/tests/phar_buildfromdirectory1.phpt ext/phar/tests/phar_buil
Commit:14d53417879256044c40b2ef8d0aa32b1f215acb Author:Michael Wallner Wed, 18 Sep 2013 10:52:51 +0200 Parents: 6866b45a48a773f434c04828c9d0a05ae9d9cf3f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=14d53417879256044c40b2ef8d0aa32b1f215acb Log: fix test concurrency Changed paths: M ext/phar/tests/031.phpt M ext/phar/tests/032.phpt M ext/phar/tests/files/phar_oo_test.inc M ext/phar/tests/phar_buildfromdirectory1.phpt M ext/phar/tests/phar_buildfromdirectory2-win.phpt M ext/phar/tests/phar_buildfromdirectory2.phpt M ext/phar/tests/phar_buildfromdirectory3.phpt M ext/phar/tests/phar_buildfromdirectory4.phpt M ext/phar/tests/phar_buildfromdirectory5.phpt M ext/phar/tests/phar_buildfromdirectory6.phpt M ext/phar/tests/phar_buildfromiterator1.phpt M ext/phar/tests/phar_buildfromiterator10.phpt M ext/phar/tests/phar_buildfromiterator2.phpt M ext/phar/tests/phar_buildfromiterator3.phpt M ext/phar/tests/phar_buildfromiterator4.phpt M ext/phar/tests/phar_buildfromiterator5.phpt M ext/phar/tests/phar_buildfromiterator6.phpt M ext/phar/tests/phar_buildfromiterator7.phpt M ext/phar/tests/phar_buildfromiterator8.phpt M ext/phar/tests/phar_buildfromiterator9.phpt M ext/phar/tests/phar_extract.phpt M ext/phar/tests/phar_extract2.phpt M ext/phar/tests/phar_extract3.phpt M ext/phar/tests/phar_oo_001.phpt M ext/phar/tests/phar_oo_001U.phpt M ext/phar/tests/phar_oo_002.phpt M ext/phar/tests/phar_oo_002U.phpt M ext/phar/tests/phar_oo_003.phpt M ext/phar/tests/phar_oo_004.phpt M ext/phar/tests/phar_oo_004U.phpt M ext/phar/tests/phar_oo_005.phpt M ext/phar/tests/phar_oo_005U.phpt M ext/phar/tests/phar_oo_005_5.2.phpt M ext/phar/tests/phar_oo_006.phpt M ext/phar/tests/phar_oo_007.phpt M ext/phar/tests/phar_oo_008.phpt M ext/phar/tests/phar_oo_009.phpt M ext/phar/tests/phar_oo_010.phpt M ext/phar/tests/phar_oo_011.phpt M ext/phar/tests/phar_oo_011b.phpt M ext/phar/tests/phar_oo_012.phpt M ext/phar/tests/phar_oo_012_confirm.phpt M ext/phar/tests/phar_oo_012b.phpt diff --git a/ext/phar/tests/031.phpt b/ext/phar/tests/031.phpt index 4d59886..d458f06 100644 --- a/ext/phar/tests/031.phpt +++ b/ext/phar/tests/031.phpt @@ -22,10 +22,10 @@ require $pname; ===DONE=== --CLEAN-- --EXPECTF-- string(25) "getMessage(); ===DONE=== --CLEAN-- --EXPECTF-- -phar "%sphar_oo_test.phar.php" does not have a signature===DONE=== \ No newline at end of file +phar "%s032.phar.php" does not have a signature===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/files/phar_oo_test.inc b/ext/phar/tests/files/phar_oo_test.inc index e92b444..4542156 100644 --- a/ext/phar/tests/files/phar_oo_test.inc +++ b/ext/phar/tests/files/phar_oo_test.inc @@ -2,7 +2,8 @@ ini_set('date.timezone', 'GMT'); -$fname = dirname(__FILE__) . '/phar_oo_test.phar.php'; +$tname = basename(current(get_included_files()), ".php"); +$fname = dirname(__FILE__) . "/$tname.phar.php"; $pname = 'phar://' . $fname; $file = (binary)''; diff --git a/ext/phar/tests/phar_buildfromdirectory1.phpt b/ext/phar/tests/phar_buildfromdirectory1.phpt index 63e06fa..957f246 100644 --- a/ext/phar/tests/phar_buildfromdirectory1.phpt +++ b/ext/phar/tests/phar_buildfromdirectory1.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- buildFromDirectory(1); @@ -19,7 +19,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory2-win.phpt b/ext/phar/tests/phar_buildfromdirectory2-win.phpt index 9dbcf96..5ed890a 100644 --- a/ext/phar/tests/phar_buildfromdirectory2-win.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2-win.phpt @@ -11,7 +11,7 @@ phar.readonly=0 --FILE-- buildFromDirectory(1); } catch (Exception $e) { var_dump(get_class($e)); @@ -21,7 +21,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index 639ff0b..a33e50a 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -11,7 +11,7 @@ phar.readonly=0 --FILE-- buildFromDirectory(1); } catch (Exception $e) { var_dump(get_class($e)); @@ -21,7 +21,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory3.phpt b/ext/phar/tests/phar_buildfromdirectory3.phpt index 2134cbd..921e395 100644 --- a/ext/phar/tests/phar_buildfromdirectory3.phpt +++ b/ext/phar/tests/phar_buildfromdirectory3.phpt @@ -9,7 +9,7 @@ phar.readonly=0 buildFromDirectory('files', new stdClass); } catch (Exception $e) { var_dump(get_class($e)); @@ -19,7 +19,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory4.phpt b/ext/phar/tests/phar_
[PHP-CVS] com php-src: fix test concurrency: ext/standard/tests/dir/chdir_basic.phpt ext/standard/tests/dir/chdir_variation2.phpt ext/standard/tests/file/bug41655_2.phpt ext/standard/tests/file/fopen_
Commit:002763fb7b603b30fab3955c0acd132298926c1b Author:Michael Wallner Wed, 18 Sep 2013 10:52:18 +0200 Parents: 4a85b5e190d6651bee26bbbeff4ed09d2932f352 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=002763fb7b603b30fab3955c0acd132298926c1b Log: fix test concurrency Changed paths: M ext/standard/tests/dir/chdir_basic.phpt M ext/standard/tests/dir/chdir_variation2.phpt M ext/standard/tests/file/bug41655_2.phpt M ext/standard/tests/file/fopen_include_path.inc M ext/standard/tests/file/fopen_variation16.phpt M ext/standard/tests/file/fopen_variation17.phpt M ext/standard/tests/file/fscanf_variation53.phpt M ext/standard/tests/file/rename_variation1.phpt M ext/standard/tests/file/rename_variation2-win32.phpt M ext/standard/tests/file/rename_variation2.phpt M ext/standard/tests/file/rename_variation3.phpt M ext/standard/tests/file/rename_variation4.phpt M ext/standard/tests/file/rename_variation5.phpt M ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt M ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt M ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt M ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt M ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt diff --git a/ext/standard/tests/dir/chdir_basic.phpt b/ext/standard/tests/dir/chdir_basic.phpt index 5fc0e5b..81d3c7c 100644 --- a/ext/standard/tests/dir/chdir_basic.phpt +++ b/ext/standard/tests/dir/chdir_basic.phpt @@ -14,40 +14,40 @@ Test chdir() function : basic functionality echo "*** Testing chdir() : basic functionality ***\n"; $base_dir_path = dirname(__FILE__); -$level_one_dir_name = "level_one"; -$level_one_dir_path = "$base_dir_path/$level_one_dir_name"; +$level1_one_dir_name = "level1_one"; +$level1_one_dir_path = "$base_dir_path/$level1_one_dir_name"; -$level_two_dir_name = "level_two"; -$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name"; +$level1_two_dir_name = "level1_two"; +$level1_two_dir_path = "$base_dir_path/$level1_one_dir_name/$level1_two_dir_name"; // create directories -mkdir($level_one_dir_path); -mkdir($level_two_dir_path); +mkdir($level1_one_dir_path); +mkdir($level1_two_dir_path); echo "\n-- Testing chdir() with absolute path: --\n"; chdir($base_dir_path); -var_dump(chdir($level_one_dir_path)); +var_dump(chdir($level1_one_dir_path)); var_dump(getcwd()); echo "\n-- Testing chdir() with relative paths: --\n"; -var_dump(chdir($level_two_dir_name)); +var_dump(chdir($level1_two_dir_name)); var_dump(getcwd()); ?> ===DONE=== --CLEAN-- --EXPECTF-- *** Testing chdir() : basic functionality *** -- Testing chdir() with absolute path: -- bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel1_one" -- Testing chdir() with relative paths: -- bool(true) -string(%d) "%slevel_one%elevel_two" +string(%d) "%slevel1_one%elevel1_two" ===DONE=== diff --git a/ext/standard/tests/dir/chdir_variation2.phpt b/ext/standard/tests/dir/chdir_variation2.phpt index fa70f9e..9ca6a97 100644 --- a/ext/standard/tests/dir/chdir_variation2.phpt +++ b/ext/standard/tests/dir/chdir_variation2.phpt @@ -15,32 +15,32 @@ echo "*** Testing chdir() : usage variations ***\n"; $base_dir_path = dirname(__FILE__); -$level_one_dir_name = "level_one"; -$level_one_dir_path = "$base_dir_path/$level_one_dir_name"; +$level2_one_dir_name = "level2_one"; +$level2_one_dir_path = "$base_dir_path/$level2_one_dir_name"; -$level_two_dir_name = "level_two"; -$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name"; +$level2_two_dir_name = "level2_two"; +$level2_two_dir_path = "$base_dir_path/$level2_one_dir_name/$level2_two_dir_name"; // create directories -mkdir($level_one_dir_path); -mkdir($level_two_dir_path); +mkdir($level2_one_dir_path); +mkdir($level2_two_dir_path); -echo "\n-- \$directory = './level_one': --\n"; +echo "\n-- \$directory = './level2_one': --\n"; var_dump(chdir($base_dir_path)); -var_dump(chdir("./$level_one_dir_name")); +var_dump(chdir("./$level2_one_dir_name")); var_dump(getcwd()); -echo "\n-- \$directory = 'level_one/level_two': --\n"; +echo "\n-- \$directory = 'level2_one/level2_two': --\n"; var_dump(chdir($base_dir_path)); -var_dump(chdir("$level_one_dir_name/$level_two_dir_name")); +var_dump(chdir("$level2_one_dir_name/$level2_two_dir_name")); var_dump(getcwd()); echo "\n-- \$directory = '..': --\n"; var_dump(chdir('..')); var_dump(getcwd()); -echo "\n--
Re: [PHP-CVS] com php-src: fix build - PRIu64 vs %I64u: main/php_variables.c
Hi Anatol! On 18 September 2013 10:34, Anatol Belski wrote: > That's a good idea, i also thought about macrifying all those at once. Not > sure it belongs to stdint, it's actually more like printf format. I'll do > this anyway, have to look for a right place. POSIX has it in inttypes.h -- Regards, Mike -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test concurrency: ext/phar/tests/phar_extract2.phpt
Commit:cdf5d201ab570284d8865a4b8366bddb662410eb Author:Michael Wallner Wed, 18 Sep 2013 11:02:45 +0200 Parents: e9877fe92e8f9a0cc212362f6c35550b92036b3e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cdf5d201ab570284d8865a4b8366bddb662410eb Log: fix test concurrency Changed paths: M ext/phar/tests/phar_extract2.phpt Diff: diff --git a/ext/phar/tests/phar_extract2.phpt b/ext/phar/tests/phar_extract2.phpt index fafe254..7de8cee 100644 --- a/ext/phar/tests/phar_extract2.phpt +++ b/ext/phar/tests/phar_extract2.phpt @@ -23,7 +23,7 @@ $phar->extractTo(dirname(__FILE__) . '/extract2', 'mount2'); $phar->extractTo(dirname(__FILE__) . '/extract2'); $out = array(); -foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x3000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract2', 0x3000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { $extracted[] = $path; } @@ -51,10 +51,10 @@ $dir = dirname(__FILE__) . '/extract1/'; @rmdir($dir); ?> --EXPECTF-- -%sextract%cfile1.txt -%sextract%cfile2.txt -%sextract%cone -%sextract%csubdir -%sextract%csubdir%cectory -%sextract%csubdir%cectory%cfile.txt +%sextract2%cfile1.txt +%sextract2%cfile2.txt +%sextract2%cone +%sextract2%csubdir +%sextract2%csubdir%cectory +%sextract2%csubdir%cectory%cfile.txt ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix a very rare case of use of uninitialized value combined with a memleak: main/fopen_wrappers.c
Commit:9bfd55cda3bd66b56af84a569fafd8a77cbb3726 Author:Michael Wallner Wed, 18 Sep 2013 11:10:55 +0200 Parents: dfd7d1063a5292b04f6134284337550f4f513749 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9bfd55cda3bd66b56af84a569fafd8a77cbb3726 Log: fix a very rare case of use of uninitialized value combined with a memleak Changed paths: M main/fopen_wrappers.c Diff: diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 6f11cf3..9b8645a 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -775,7 +775,12 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co * we cannot cannot getcwd() and the requested, * relatively referenced file is accessible */ copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); - real_path = estrndup(filepath, copy_len); + if (real_path) { + memcpy(real_path, filepath, copy_len); + real_path[copy_len] = '\0'; + } else { + real_path = estrndup(filepath, copy_len); + } close(fdtest); return real_path; } else { -- 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.5': main/fopen_wrappers.c
Commit:33c4b61c7f477994d4f30fff349cb1815680642d Author:Michael Wallner Wed, 18 Sep 2013 11:12:44 +0200 Parents: cdf5d201ab570284d8865a4b8366bddb662410eb a34b141e08f02c34a100676080dddf7d9be84544 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=33c4b61c7f477994d4f30fff349cb1815680642d Log: Merge branch 'PHP-5.5' * PHP-5.5: fix a very rare case of use of uninitialized value combined with a memleak Changed paths: MM main/fopen_wrappers.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 note about request_body and php://input: main/SAPI.h
Commit:11d60447f9f22944dd08d8dacba1230fc4caabd8 Author:Michael Wallner Thu, 19 Sep 2013 15:40:10 +0200 Parents: b6d0cb05533d1c7a8f0cce5cffc20352669a2506 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11d60447f9f22944dd08d8dacba1230fc4caabd8 Log: add note about request_body and php://input Changed paths: M main/SAPI.h Diff: diff --git a/main/SAPI.h b/main/SAPI.h index 5525a2a..928fca9 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -85,6 +85,7 @@ typedef struct { char *path_translated; char *request_uri; + /* Do not use request_body directly, but the php://input stream wrapper instead */ struct _php_stream *request_body; const char *content_type; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test: ext/ldap/tests/ldap_search_variation6.phpt
Commit:2b78edfba25afac8f34ca65e18f98d23a4b8bcce Author:Michael Wallner Mon, 30 Sep 2013 11:41:35 +0200 Parents: e9e63f922303d852b6899cadd68d7ec73e8f6134 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2b78edfba25afac8f34ca65e18f98d23a4b8bcce Log: fix test Changed paths: M ext/ldap/tests/ldap_search_variation6.phpt Diff: diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt index a29e452..5139ebb 100644 --- a/ext/ldap/tests/ldap_search_variation6.phpt +++ b/ext/ldap/tests/ldap_search_variation6.phpt @@ -217,14 +217,26 @@ array(2) { [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} array(2) { [0]=> resource(%d) of type (ldap result) [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix memleak on resetting rebind_proc: ext/ldap/ldap.c
Commit:e9e63f922303d852b6899cadd68d7ec73e8f6134 Author:Michael Wallner Mon, 30 Sep 2013 11:23:33 +0200 Parents: f0c926564c5f7de9462d9ca7bd75014b14a63f56 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e9e63f922303d852b6899cadd68d7ec73e8f6134 Log: fix memleak on resetting rebind_proc Changed paths: M ext/ldap/ldap.c Diff: diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3cfa209..71d57d6 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* unregister rebind procedure */ if (ld->rebindproc != NULL) { zval_dtor(ld->rebindproc); + FREE_ZVAL(ld->rebindproc); ld->rebindproc = NULL; ldap_set_rebind_proc(ld->link, NULL, NULL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #61548: NEWS ext/standard/http_fopen_wrapper.c ext/standard/tests/http/bug61548.phpt
Commit:18b04b480ebc41841b2004cc11797eda40fb3958 Author:Michael Wallner Tue, 1 Oct 2013 11:07:55 +0200 Parents: 679bf479b63356f977c0bb04b5650b86cd4e15a1 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=18b04b480ebc41841b2004cc11797eda40fb3958 Log: Fixed bug #61548 Bugs: https://bugs.php.net/61548 Changed paths: M NEWS M ext/standard/http_fopen_wrapper.c A ext/standard/tests/http/bug61548.phpt Diff: diff --git a/NEWS b/NEWS index 4dc7ef7..9bb6032 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,10 @@ PHP NEWS . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling imap). (ryotakatsuki at gmail dot com) +- Standard: + . Fixed bug #61548 (content-type must appear at the end of headers for 201 +Location to work in http). (Mike) + 19 Sep 2013, PHP 5.4.20 - Core: diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index b8676bb..4605e74 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -84,6 +84,30 @@ #define HTTP_WRAPPER_HEADER_INIT1 #define HTTP_WRAPPER_REDIRECTED 2 +static inline void strip_header(char *header_bag, char *lc_header_bag, + const char *lc_header_name) +{ + char *lc_header_start = strstr(lc_header_bag, lc_header_name); + char *header_start = header_bag + (lc_header_start - lc_header_bag); + + if (lc_header_start + && (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n') + ) { + char *lc_eol = strchr(lc_header_start, '\n'); + char *eol = header_start + (lc_eol - lc_header_start); + + if (lc_eol) { + size_t eollen = strlen(lc_eol); + + memmove(lc_header_start, lc_eol+1, eollen); + memmove(header_start, eol+1, eollen); + } else { + *lc_header_start = '\0'; + *header_start = '\0'; + } + } +} + php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; @@ -425,40 +449,17 @@ finish: if (tmp && strlen(tmp) > 0) { char *s; - if (!header_init) { /* Remove post headers for redirects */ - int l = strlen(tmp); - char *s2, *tmp_c = estrdup(tmp); - - php_strtolower(tmp_c, l); - if ((s = strstr(tmp_c, "content-length:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - int b = tmp_c + l - 1 - s2; - memmove(tmp, tmp + (s2 + 1 - tmp_c), b); - memmove(tmp_c, s2 + 1, b); - - } else { - tmp[s - tmp_c] = *s = '\0'; - } - l = strlen(tmp_c); - } - if ((s = strstr(tmp_c, "content-type:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - memmove(tmp, tmp + (s2 + 1 - tmp_c), tmp_c + l - 1 - s2); - } else { - tmp[s - tmp_c] = '\0'; - } - } - - efree(tmp_c); - tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, NULL, 3 TSRMLS_CC); - efree(tmp); - tmp = tmp_c; - } - user_headers = estrdup(tmp); /* Make lowercase for easy comparison against 'standard' headers */ php_strtolower(tmp, strlen(tmp)); + + if (!header_init) { + /* strip POST headers on redirect */ + strip_header(user_headers, tmp, "content-length:"); + strip_header(user_headers, tmp, "content-type:"); + } + if ((s = strstr(tmp, "user-agent:")) &&
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/standard/http_fopen_wrapper.c
Commit:d29a01de3f35a33c539a805e28a22a6514924a19 Author:Michael Wallner Tue, 1 Oct 2013 11:11:48 +0200 Parents: 66cd9ef04cf20ead3db58f0bb387bb2070dbc591 ad139d9a00d9de206c7aae4f85eff08eff2c429e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d29a01de3f35a33c539a805e28a22a6514924a19 Log: Merge branch 'PHP-5.5' * PHP-5.5: Fixed bug #61548 Conflicts: ext/standard/http_fopen_wrapper.c Bugs: https://bugs.php.net/61548 Changed paths: MM ext/standard/http_fopen_wrapper.c Diff: diff --cc ext/standard/http_fopen_wrapper.c index 8762fa4,4605e74..f5184ce --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@@ -85,8 -84,31 +85,33 @@@ #define HTTP_WRAPPER_HEADER_INIT1 #define HTTP_WRAPPER_REDIRECTED 2 - php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ + static inline void strip_header(char *header_bag, char *lc_header_bag, + const char *lc_header_name) + { + char *lc_header_start = strstr(lc_header_bag, lc_header_name); + char *header_start = header_bag + (lc_header_start - lc_header_bag); + + if (lc_header_start + && (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n') + ) { + char *lc_eol = strchr(lc_header_start, '\n'); + char *eol = header_start + (lc_eol - lc_header_start); + + if (lc_eol) { + size_t eollen = strlen(lc_eol); + + memmove(lc_header_start, lc_eol+1, eollen); + memmove(header_start, eol+1, eollen); + } else { + *lc_header_start = '\0'; + *header_start = '\0'; + } + } + } + -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ ++php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, ++ const char *path, const char *mode, int options, char **opened_path, ++ php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; php_url *resource = NULL; -- 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: run-tests.php
Commit:4b61203b013468992dc86dea74379a5688ba19c7 Author:Michael Wallner Tue, 1 Oct 2013 17:01:44 +0200 Parents: ad139d9a00d9de206c7aae4f85eff08eff2c429e cd1cab3f4726751a0476ac8701ce09cc37cb36df Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b61203b013468992dc86dea74379a5688ba19c7 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode()) Bugs: https://bugs.php.net/62396 Changed paths: MM run-tests.php Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode()): NEWS run-tests.php
Commit:cd1cab3f4726751a0476ac8701ce09cc37cb36df Author:Michael Wallner Tue, 1 Oct 2013 17:01:03 +0200 Parents: 18b04b480ebc41841b2004cc11797eda40fb3958 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cd1cab3f4726751a0476ac8701ce09cc37cb36df Log: fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode()) Bugs: https://bugs.php.net/62396 Changed paths: M NEWS M run-tests.php Diff: diff --git a/NEWS b/NEWS index 9bb6032..b889e66 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,11 @@ PHP NEWS . Fixed bug #61548 (content-type must appear at the end of headers for 201 Location to work in http). (Mike) +- Build system: + . Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing +gzencode())). (Mike) + + 19 Sep 2013, PHP 5.4.20 - Core: diff --git a/run-tests.php b/run-tests.php index 935f821..317f607 100755 --- a/run-tests.php +++ b/run-tests.php @@ -455,7 +455,7 @@ $pass_options = ''; $compression = 0; $output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt'; -if ($compression) { +if ($compression && in_array("compress.zlib", stream_get_filters())) { $output_file = 'compress.zlib://' . $output_file . '.gz'; } @@ -1545,6 +1545,16 @@ TEST $file } } } + + if (!extension_loaded("zlib") + && (array_key_exists("GZIP_POST", $section_text) + || array_key_exists("DEFLATE_POST", $section_text)) + ) { + $message = "ext/zlib required"; + show_result('SKIP', $tested, $tested_file, "reason: $message", $temp_filenames); + junit_mark_test_as('SKIP', $shortname, $tested, null, ""); + return 'SKIPPED'; + } if (@count($section_text['REDIRECTTEST']) == 1) { $test_files = array(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix bug #65808 the socket_connect() won't work with IPv6 address: NEWS ext/sockets/sockets.c
Commit:9209c19f8f7eef807cb457b32d3ab517ff8dc178 Author:Michael Wallner Wed, 2 Oct 2013 15:19:25 +0200 Parents: b2f8f35a889e77c3123ade348907e73bf6d6689e Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9209c19f8f7eef807cb457b32d3ab517ff8dc178 Log: fix bug #65808 the socket_connect() won't work with IPv6 address Bugs: https://bugs.php.net/65808 Changed paths: M NEWS M ext/sockets/sockets.c Diff: diff --git a/NEWS b/NEWS index 9bef174..c2086c07 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.4.22 +- Sockets: + . Fixed bug #65808 (the socket_connect() won't work with IPv6 address). +(Mike) + ?? ??? 2013, PHP 5.4.21 - Core: diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index d0d0294..d094b3c 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -607,6 +607,8 @@ static char *php_strerror(int error TSRMLS_DC) /* {{{ */ /* }}} */ #if HAVE_IPV6 +static int php_get_if_index_from_string(const char *val, unsigned *out TSRMLS_DC); + /* Sets addr by hostname, or by ip in string form (AF_INET6) */ static int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */ { @@ -615,6 +617,7 @@ static int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socke struct addrinfo hints; struct addrinfo *addrinfo = NULL; #endif + char *scope = strchr(string, '%'); if (inet_pton(AF_INET6, string, &tmp)) { memcpy(&(sin6->sin6_addr.s6_addr), &(tmp.s6_addr), sizeof(struct in6_addr)); @@ -649,6 +652,22 @@ static int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socke } + if (scope++) { + long lval = 0; + double dval = 0; + unsigned scope_id = 0; + + if (IS_LONG == is_numeric_string(scope, strlen(scope), &lval, &dval, 0)) { + if (lval > 0 && lval <= UINT_MAX) { + scope_id = lval; + } + } else { + php_get_if_index_from_string(scope, &scope_id TSRMLS_CC); + } + + sin6->sin6_scope_id = scope_id; + } + return 1; } /* }}} */ @@ -714,6 +733,28 @@ static int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char return 0; } +static int php_get_if_index_from_string(const char *val, unsigned *out TSRMLS_DC) +{ +#if HAVE_IF_NAMETOINDEX + unsigned int ind; + + ind = if_nametoindex(val); + if (ind == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "no interface with name \"%s\" could be found", val); + return FAILURE; + } else { + *out = ind; + return SUCCESS; + } +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "this platform does not support looking up an interface by " + "name, an integer interface index must be supplied instead"); + return FAILURE; +#endif +} + static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) { int ret; @@ -729,26 +770,10 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) ret = SUCCESS; } } else { -#if HAVE_IF_NAMETOINDEX - unsigned int ind; zval_add_ref(&val); convert_to_string_ex(&val); - ind = if_nametoindex(Z_STRVAL_P(val)); - if (ind == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "no interface with name \"%s\" could be found", Z_STRVAL_P(val)); - ret = FAILURE; - } else { - *out = ind; - ret = SUCCESS; - } + ret = php_get_if_index_from_string(Z_STRVAL_P(val), out TSRMLS_CC); zval_ptr_dtor(&val); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "this platform does not support looking up an interface by " - "name, an integer interface index must be supplied instead"); - ret = FAILURE; -#endif } return ret; -- 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/sockets/multicast.c ext/sockets/multicast.h ext/sockets/sockaddr_conv.c
Commit:2ba39268151549f03140ec3d260cf9489336ec93 Author:Michael Wallner Wed, 2 Oct 2013 15:55:38 +0200 Parents: 60e38b3243577abc80ce6bbcfb0b4125b08acb85 9209c19f8f7eef807cb457b32d3ab517ff8dc178 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ba39268151549f03140ec3d260cf9489336ec93 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: fix bug #65808the socket_connect() won't work with IPv6 address 5.4.22-dev now Conflicts: configure.in ext/sockets/sockets.c main/php_version.h Bugs: https://bugs.php.net/65808 Changed paths: MM ext/sockets/multicast.c MM ext/sockets/multicast.h MA ext/sockets/sockaddr_conv.c diff --cc ext/sockets/multicast.c index 7466c62,43b6f7d..ecf3a65 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@@ -63,309 -73,6 +63,317 @@@ static const char *_php_source_op_to_st static int _php_source_op_to_ipv4_op(enum source_op sop); #endif ++int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC) ++{ ++#if HAVE_IF_NAMETOINDEX ++ unsigned int ind; ++ ++ ind = if_nametoindex(val); ++ if (ind == 0) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, ++ "no interface with name \"%s\" could be found", val); ++ return FAILURE; ++ } else { ++ *out = ind; ++ return SUCCESS; ++ } ++#else ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, ++ "this platform does not support looking up an interface by " ++ "name, an integer interface index must be supplied instead"); ++ return FAILURE; ++#endif ++} ++ +static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) +{ + int ret; + + if (Z_TYPE_P(val) == IS_LONG) { + if (Z_LVAL_P(val) < 0 || Z_LVAL_P(val) > UINT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "the interface index cannot be negative or larger than %u;" + " given %ld", UINT_MAX, Z_LVAL_P(val)); + ret = FAILURE; + } else { + *out = Z_LVAL_P(val); + ret = SUCCESS; + } + } else { - #if HAVE_IF_NAMETOINDEX - unsigned int ind; + zval_add_ref(&val); + convert_to_string_ex(&val); - ind = if_nametoindex(Z_STRVAL_P(val)); - if (ind == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "no interface with name \"%s\" could be found", Z_STRVAL_P(val)); - ret = FAILURE; - } else { - *out = ind; - ret = SUCCESS; - } ++ ret = php_string_to_if_index(Z_STRVAL_P(val), out TSRMLS_CC); + zval_ptr_dtor(&val); - #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "this platform does not support looking up an interface by " - "name, an integer interface index must be supplied instead"); - ret = FAILURE; - #endif + } + + return ret; +} + ++ ++ +static int php_get_if_index_from_array(const HashTable *ht, const char *key, + php_socket *sock, unsigned int *if_index TSRMLS_DC) +{ + zval **val; + + if (zend_hash_find(ht, key, strlen(key) + 1, (void **)&val) == FAILURE) { + *if_index = 0; /* default: 0 */ + return SUCCESS; + } + + return php_get_if_index_from_zval(*val, if_index TSRMLS_CC); +} + +static int php_get_address_from_array(const HashTable *ht, const char *key, + php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len TSRMLS_DC) +{ + zval **val, + *valcp; + + if (zend_hash_find(ht, key, strlen(key) + 1, (void **)&val) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", key); + return FAILURE; + } + valcp = *val; + zval_add_ref(&valcp); + convert_to_string_ex(val); + if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(valcp), sock TSRMLS_CC)) { + zval_ptr_dtor(&valcp); + return FAILURE; + } + zval_ptr_dtor(&valcp); + return SUCCESS; +} + +static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval **arg4 TSRMLS_DC) +{ + HashTable *opt_ht; + unsigned intif_index; + int retval; + int (*mcast_req_fun)(
Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/sockets/multicast.c ext/sockets/multicast.h ext/sockets/sockaddr_conv.c
Gustavo, feel free to improve the aesthetics of my merge. I was quite surprised by the amount of difference of the source layout :) On 2 October 2013 15:55, Michael Wallner wrote: > Commit:2ba39268151549f03140ec3d260cf9489336ec93 > Author:Michael Wallner Wed, 2 Oct 2013 15:55:38 > +0200 > Parents: 60e38b3243577abc80ce6bbcfb0b4125b08acb85 > 9209c19f8f7eef807cb457b32d3ab517ff8dc178 > Branches: PHP-5.5 master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=2ba39268151549f03140ec3d260cf9489336ec93 > > Log: > Merge branch 'PHP-5.4' into PHP-5.5 > > * PHP-5.4: > fix bug #65808the socket_connect() won't work with IPv6 address > 5.4.22-dev now > > Conflicts: > configure.in > ext/sockets/sockets.c > main/php_version.h > > Bugs: > https://bugs.php.net/65808 > > Changed paths: > MM ext/sockets/multicast.c > MM ext/sockets/multicast.h > MA ext/sockets/sockaddr_conv.c > > > -- > 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