[PHP-CVS] cvs: php-src(PHP_5_2) /ext/curl interface.c
pajoye Thu Apr 16 13:51:55 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/curl interface.c Log: - improve file:// deactivation in curl_init and do not allow to enable it again manually http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.44&r2=1.62.2.14.2.45&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.44 php-src/ext/curl/interface.c:1.62.2.14.2.45 --- php-src/ext/curl/interface.c:1.62.2.14.2.44 Thu Apr 16 09:47:33 2009 +++ php-src/ext/curl/interface.cThu Apr 16 13:51:55 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.44 2009/04/16 09:47:33 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.45 2009/04/16 13:51:55 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -147,6 +147,7 @@ #endif /* }}} */ +static void _php_curl_close_ex(php_curl *ch TSRMLS_DC); static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); #define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; @@ -1170,6 +1171,7 @@ if (argc > 0) { if (!php_curl_option_url(ch, Z_STRVAL_PP(url), Z_STRLEN_PP(url))) { + _php_curl_close_ex(ch); RETURN_FALSE; } } @@ -1331,6 +1333,13 @@ case CURLOPT_PROTOCOLS: #endif convert_to_long_ex(zvalue); +#if LIBCURL_VERSION_NUM >= 0x71304 + if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set"); + RETVAL_FALSE; + return 1; + } +#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; case CURLOPT_FOLLOWLOCATION: @@ -2011,10 +2020,8 @@ /* {{{ _php_curl_close() List destructor for curl handles */ -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _php_curl_close_ex(php_curl *ch TSRMLS_DC) { - php_curl *ch = (php_curl *) rsrc->ptr; - #if PHP_CURL_DEBUG fprintf(stderr, "DTOR CALLED, ch = %x\n", ch); #endif @@ -2053,6 +2060,15 @@ } /* }}} */ +/* {{{ _php_curl_close() + List destructor for curl handles */ +static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) +{ + php_curl *ch = (php_curl *) rsrc->ptr; + _php_curl_close_ex(ch TSRMLS_CC); +} +/* }}} */ + #endif /* HAVE_CURL */ /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
bjori Thu Apr 16 13:53:26 2009 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1470&r2=1.2027.2.547.2.1471&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1470 php-src/NEWS:1.2027.2.547.2.1471 --- php-src/NEWS:1.2027.2.547.2.1470Wed Apr 15 14:25:06 2009 +++ php-src/NEWSThu Apr 16 13:53:24 2009 @@ -10,6 +10,7 @@ - Fixed memory leak in ob_get_clean/ob_get_flush. (Christian) - Fixed segfault on invalid session.save_path. (Hannes) +- Fixed bug #47981 (error handler not called regardless). (Hannes) - Fixed bug #47969 (ezmlm_hash() returns different values depend on OS). (Ilia) - Fixed bug #47946 (ImageConvolution overwrites background). (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_firebird firebird_driver.c
iliaa Thu Apr 16 22:14:52 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo_firebird firebird_driver.c Log: MFB: Fixed compiler warning http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_driver.c?r1=1.17.2.2.2.6&r2=1.17.2.2.2.7&diff_format=u Index: php-src/ext/pdo_firebird/firebird_driver.c diff -u php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.6 php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.7 --- php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.6 Wed Dec 31 11:17:41 2008 +++ php-src/ext/pdo_firebird/firebird_driver.c Thu Apr 16 22:14:52 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: firebird_driver.c,v 1.17.2.2.2.6 2008/12/31 11:17:41 sebastian Exp $ */ +/* $Id: firebird_driver.c,v 1.17.2.2.2.7 2009/04/16 22:14:52 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,6 +25,9 @@ #define _GNU_SOURCE #include "php.h" +#ifdef ZEND_ENGINE_2 +# include "zend_exceptions.h" +#else #include "php_ini.h" #include "ext/standard/info.h" #include "pdo/php_pdo.h" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo_firebird firebird_driver.c
iliaa Thu Apr 16 22:14:44 2009 UTC Modified files: /php-src/ext/pdo_firebird firebird_driver.c Log: MFB: Fixed compiler warning http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_driver.c?r1=1.27&r2=1.28&diff_format=u Index: php-src/ext/pdo_firebird/firebird_driver.c diff -u php-src/ext/pdo_firebird/firebird_driver.c:1.27 php-src/ext/pdo_firebird/firebird_driver.c:1.28 --- php-src/ext/pdo_firebird/firebird_driver.c:1.27 Tue Mar 10 23:39:28 2009 +++ php-src/ext/pdo_firebird/firebird_driver.c Thu Apr 16 22:14:44 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: firebird_driver.c,v 1.27 2009/03/10 23:39:28 helly Exp $ */ +/* $Id: firebird_driver.c,v 1.28 2009/04/16 22:14:44 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,6 +25,9 @@ #define _GNU_SOURCE #include "php.h" +#ifdef ZEND_ENGINE_2 +# include "zend_exceptions.h" +#else #include "php_ini.h" #include "ext/standard/info.h" #include "pdo/php_pdo.h" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo_firebird firebird_driver.c
iliaa Thu Apr 16 22:14:28 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pdo_firebird firebird_driver.c Log: Fixed compiler warning http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_driver.c?r1=1.17.2.2.2.4.2.6&r2=1.17.2.2.2.4.2.7&diff_format=u Index: php-src/ext/pdo_firebird/firebird_driver.c diff -u php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.4.2.6 php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.4.2.7 --- php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.4.2.6 Sun Feb 15 21:51:00 2009 +++ php-src/ext/pdo_firebird/firebird_driver.c Thu Apr 16 22:14:28 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: firebird_driver.c,v 1.17.2.2.2.4.2.6 2009/02/15 21:51:00 felipe Exp $ */ +/* $Id: firebird_driver.c,v 1.17.2.2.2.4.2.7 2009/04/16 22:14:28 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,6 +25,9 @@ #define _GNU_SOURCE #include "php.h" +#ifdef ZEND_ENGINE_2 +# include "zend_exceptions.h" +#else #include "php_ini.h" #include "ext/standard/info.h" #include "pdo/php_pdo.h" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard mail.c
The initial type change does the trick for the formula itself. And yes, the code relies on an integer being 64bit Ilia Alshanetsky On 15-Apr-09, at 2:05 PM, Matt Wilmas wrote: Hi Ilia, - Original Message - From: "Ilia Alshanetsky" Sent: Wednesday, April 15, 2009 iliaa Wed Apr 15 14:24:38 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard mail.c Log: Fixed bug #47969 (ezmlm_hash() returns different values depend on OS) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/mail.c?r1=1.87.2.1.2.7.2.9&r2=1.87.2.1.2.7.2.10&diff_format=u [...] @@ -76,7 +76,7 @@ PHP_FUNCTION(ezmlm_hash) { char *str = NULL; - unsigned long h = 5381L; + unsigned int h = 5381; You're relying on int being 32-bit? Couldn't it be 64-bit as well? http://en.wikipedia.org/wiki/64-bit#64-bit_data_models BTW, (unsigned long) cast is still used in the loop, although I guess it's not affecting that expression... And the cast in RETURN_LONG((int) h); isn't needed, but that was true before. Just noticed while checking if I was missing something else. :-) - Matt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/curl interface.c
pajoye Thu Apr 16 14:26:09 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/curl interface.c Log: - fix zts build http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.45&r2=1.62.2.14.2.46&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.45 php-src/ext/curl/interface.c:1.62.2.14.2.46 --- php-src/ext/curl/interface.c:1.62.2.14.2.45 Thu Apr 16 13:51:55 2009 +++ php-src/ext/curl/interface.cThu Apr 16 14:26:09 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.45 2009/04/16 13:51:55 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.46 2009/04/16 14:26:09 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -168,6 +168,7 @@ #if LIBCURL_VERSION_NUM < 0x071100 char *copystr = NULL; #endif + TSRMLS_FETCH(); /* Disable file:// if open_basedir or safe_mode are used */ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { @@ -1171,7 +1172,7 @@ if (argc > 0) { if (!php_curl_option_url(ch, Z_STRVAL_PP(url), Z_STRLEN_PP(url))) { - _php_curl_close_ex(ch); + _php_curl_close_ex(ch TSRMLS_CC); RETURN_FALSE; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php
bjori Thu Apr 16 13:43:28 2009 UTC Modified files: (Branch: PHP_5_2) /php-srcrun-tests.php Log: MFH: sync WS http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.60&r2=1.226.2.37.2.61&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.60 php-src/run-tests.php:1.226.2.37.2.61 --- php-src/run-tests.php:1.226.2.37.2.60 Thu Apr 16 13:41:50 2009 +++ php-src/run-tests.php Thu Apr 16 13:43:28 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.60 2009/04/16 13:41:50 bjori Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.61 2009/04/16 13:43:28 bjori Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -632,7 +632,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.60 $' . "\n"; + echo '$Revision: 1.226.2.37.2.61 $' . "\n"; exit(1); default: @@ -1753,7 +1753,7 @@ $wanted_re = preg_replace('/\r\n/', "\n", $wanted); if (isset($section_text['EXPECTF'])) { - + // do preg_quote, but miss out any %r delimited sections $temp = ""; $r = "%r"; @@ -1773,7 +1773,7 @@ $start = $end = $length; } // quote a non re portion of the string - $temp = $temp . preg_quote(substr($wanted_re, $startOffset, ($start - $startOffset)), '/'); + $temp = $temp . preg_quote(substr($wanted_re, $startOffset, ($start - $startOffset)), '/'); // add the re unquoted. $temp = $temp . '(' . substr($wanted_re, $start+2, ($end - $start-2)). ')'; $startOffset = $end + 2; @@ -1828,14 +1828,14 @@ $php = $old_php; } -if (!$leaked && !$failed_headers) { -if (isset($section_text['XFAIL'] )) { -$warn = true; -$info = " (warn: XFAIL section but test passes)"; -}else { -show_result("PASS", $tested, $tested_file, '', $temp_filenames); -return 'PASSED'; -} + if (!$leaked && !$failed_headers) { + if (isset($section_text['XFAIL'] )) { + $warn = true; + $info = " (warn: XFAIL section but test passes)"; + }else { + show_result("PASS", $tested, $tested_file, '', $temp_filenames); + return 'PASSED'; + } } } @@ -1857,14 +1857,14 @@ $php = $old_php; } -if (!$leaked && !$failed_headers) { -if (isset($section_text['XFAIL'] )) { -$warn = true; -$info = " (warn: XFAIL section but test passes)"; -}else { -show_result("PASS", $tested, $tested_file, '', $temp_filenames); -return 'PASSED'; -} + if (!$leaked && !$failed_headers) { + if (isset($section_text['XFAIL'] )) { + $warn = true; + $info = " (warn: XFAIL section but test passes)"; + }else { + show_result("PASS", $tested, $tested_file, '', $temp_filenames); + return 'PASSED'; + } } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php
bjori Thu Apr 16 13:41:50 2009 UTC Modified files: (Branch: PHP_5_2) /php-srcrun-tests.php Log: MFH: make it possible to run on 5.2.7 http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.59&r2=1.226.2.37.2.60&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.59 php-src/run-tests.php:1.226.2.37.2.60 --- php-src/run-tests.php:1.226.2.37.2.59 Thu Mar 12 20:45:43 2009 +++ php-src/run-tests.php Thu Apr 16 13:41:50 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.59 2009/03/12 20:45:43 zoe Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.60 2009/04/16 13:41:50 bjori Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -59,11 +59,26 @@ exit; } -// __DIR__ is available from 5.3.0 +// Version constants only available as of 5.2.8 +if (!defined("PHP_VERSION_ID")) { + list($major, $minor, $bug) = explode(".", phpversion(), 3); + $bug = (int)$bug; // Many distros make up their own versions + if ($bug < 10) { + $bug = "0$bug"; + } + + define("PHP_VERSION_ID", "{$major}0{$minor}$bug"); + define("PHP_MAJOR_VERSION", $major); +} + +// __DIR__ and FILE_BINARY is available from 5.3.0 if (PHP_VERSION_ID < 50300) { define('__DIR__', realpath(dirname(__FILE__))); + define('FILE_BINARY', 0); } + + // If timezone is not set, use UTC. if (ini_get('date.timezone') == '') { date_default_timezone_set('UTC'); @@ -617,7 +632,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.59 $' . "\n"; + echo '$Revision: 1.226.2.37.2.60 $' . "\n"; exit(1); default: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php
bjori Thu Apr 16 13:41:25 2009 UTC Modified files: (Branch: PHP_5_3) /php-srcrun-tests.php Log: MFH: Make it possible to run on 5.2 http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.63&r2=1.226.2.37.2.35.2.64&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.63 php-src/run-tests.php:1.226.2.37.2.35.2.64 --- php-src/run-tests.php:1.226.2.37.2.35.2.63 Thu Mar 12 20:42:46 2009 +++ php-src/run-tests.php Thu Apr 16 13:41:25 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.35.2.63 2009/03/12 20:42:46 zoe Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.35.2.64 2009/04/16 13:41:25 bjori Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -59,11 +59,26 @@ exit; } -// __DIR__ is available from 5.3.0 +// Version constants only available as of 5.2.8 +if (!defined("PHP_VERSION_ID")) { + list($major, $minor, $bug) = explode(".", phpversion(), 3); + $bug = (int)$bug; // Many distros make up their own versions + if ($bug < 10) { + $bug = "0$bug"; + } + + define("PHP_VERSION_ID", "{$major}0{$minor}$bug"); + define("PHP_MAJOR_VERSION", $major); +} + +// __DIR__ and FILE_BINARY is available from 5.3.0 if (PHP_VERSION_ID < 50300) { define('__DIR__', realpath(dirname(__FILE__))); + define('FILE_BINARY', 0); } + + // If timezone is not set, use UTC. if (ini_get('date.timezone') == '') { date_default_timezone_set('UTC'); @@ -617,7 +632,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.35.2.63 $' . "\n"; + echo '$Revision: 1.226.2.37.2.35.2.64 $' . "\n"; exit(1); default: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
bjori Thu Apr 16 13:40:47 2009 UTC Modified files: /php-srcrun-tests.php Log: Make it possible to run on PHP5.2 http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.394&r2=1.395&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.394 php-src/run-tests.php:1.395 --- php-src/run-tests.php:1.394 Thu Apr 16 13:39:31 2009 +++ php-src/run-tests.php Thu Apr 16 13:40:47 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.394 2009/04/16 13:39:31 bjori Exp $ */ +/* $Id: run-tests.php,v 1.395 2009/04/16 13:40:47 bjori Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -59,11 +59,26 @@ exit; } -// __DIR__ is available from 5.3.0 +// Version constants only available as of 5.2.8 +if (!defined("PHP_VERSION_ID")) { + list($major, $minor, $bug) = explode(".", phpversion(), 3); + $bug = (int)$bug; // Many distros make up their own versions + if ($bug < 10) { + $bug = "0$bug"; + } + + define("PHP_VERSION_ID", "{$major}0{$minor}$bug"); + define("PHP_MAJOR_VERSION", $major); +} + +// __DIR__ and FILE_BINARY is available from 5.3.0 if (PHP_VERSION_ID < 50300) { define('__DIR__', realpath(dirname(__FILE__))); + define('FILE_BINARY', 0); } + + // If timezone is not set, use UTC. if (ini_get('date.timezone') == '') { date_default_timezone_set('UTC'); @@ -617,7 +632,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.394 $' . "\n"; + echo '$Revision: 1.395 $' . "\n"; exit(1); default: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
bjori Thu Apr 16 13:39:31 2009 UTC Modified files: /php-srcrun-tests.php Log: Sync WS with 5.3 http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.393&r2=1.394&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.393 php-src/run-tests.php:1.394 --- php-src/run-tests.php:1.393 Thu Mar 12 20:39:02 2009 +++ php-src/run-tests.php Thu Apr 16 13:39:31 2009 @@ -2,7 +2,7 @@ http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/strings strstr.phpt vfprintf_error1.phpt vfprintf_error2.phpt vfprintf_error3.phpt vfprintf_error4.phpt
zoe Thu Apr 16 12:28:03 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/strings vfprintf_error3.phpt vfprintf_error2.phpt vfprintf_error1.phpt strstr.phpt vfprintf_error4.phpt Log: fixing incorrect --CLEAN-- sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error3.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/standard/tests/strings/vfprintf_error3.phpt diff -u php-src/ext/standard/tests/strings/vfprintf_error3.phpt:1.1.2.1 php-src/ext/standard/tests/strings/vfprintf_error3.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/vfprintf_error3.phpt:1.1.2.1 Fri Jun 20 04:21:58 2008 +++ php-src/ext/standard/tests/strings/vfprintf_error3.phpt Thu Apr 16 12:28:03 2009 @@ -39,7 +39,7 @@ --CLEAN-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error2.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/standard/tests/strings/vfprintf_error2.phpt diff -u php-src/ext/standard/tests/strings/vfprintf_error2.phpt:1.1.2.1 php-src/ext/standard/tests/strings/vfprintf_error2.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/vfprintf_error2.phpt:1.1.2.1 Fri Jun 20 04:21:58 2008 +++ php-src/ext/standard/tests/strings/vfprintf_error2.phpt Thu Apr 16 12:28:03 2009 @@ -30,7 +30,7 @@ --CLEAN-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error1.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/standard/tests/strings/vfprintf_error1.phpt diff -u php-src/ext/standard/tests/strings/vfprintf_error1.phpt:1.1.2.1 php-src/ext/standard/tests/strings/vfprintf_error1.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/vfprintf_error1.phpt:1.1.2.1 Fri Jun 20 04:21:58 2008 +++ php-src/ext/standard/tests/strings/vfprintf_error1.phpt Thu Apr 16 12:28:03 2009 @@ -31,7 +31,7 @@ --CLEAN-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strstr.phpt?r1=1.2.6.1.2.3&r2=1.2.6.1.2.4&diff_format=u Index: php-src/ext/standard/tests/strings/strstr.phpt diff -u php-src/ext/standard/tests/strings/strstr.phpt:1.2.6.1.2.3 php-src/ext/standard/tests/strings/strstr.phpt:1.2.6.1.2.4 --- php-src/ext/standard/tests/strings/strstr.phpt:1.2.6.1.2.3 Fri Feb 1 13:41:19 2008 +++ php-src/ext/standard/tests/strings/strstr.phpt Thu Apr 16 12:28:03 2009 @@ -170,7 +170,6 @@ echo "\nDone"; ---CLEAN-- fclose($resource1); closedir($resource2); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error4.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/standard/tests/strings/vfprintf_error4.phpt diff -u php-src/ext/standard/tests/strings/vfprintf_error4.phpt:1.1.2.2 php-src/ext/standard/tests/strings/vfprintf_error4.phpt:1.1.2.3 --- php-src/ext/standard/tests/strings/vfprintf_error4.phpt:1.1.2.2 Sun Aug 10 21:49:01 2008 +++ php-src/ext/standard/tests/strings/vfprintf_error4.phpt Thu Apr 16 12:28:03 2009 @@ -28,7 +28,7 @@ --CLEAN-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/dir dir_variation8.phpt
zoe Thu Apr 16 12:27:31 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/dir dir_variation8.phpt Log: fixing incorrect --CLEAN-- sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/dir_variation8.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/standard/tests/dir/dir_variation8.phpt diff -u php-src/ext/standard/tests/dir/dir_variation8.phpt:1.1.2.2 php-src/ext/standard/tests/dir/dir_variation8.phpt:1.1.2.3 --- php-src/ext/standard/tests/dir/dir_variation8.phpt:1.1.2.2 Mon Dec 24 05:19:42 2007 +++ php-src/ext/standard/tests/dir/dir_variation8.phpt Thu Apr 16 12:27:31 2009 @@ -35,15 +35,6 @@ echo "Done"; ?> ---CLEAN-- - --EXPECTF-- *** Testing dir() : checking with wildcard characters *** -- wildcard = '*' -- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/file 005_variation.phpt copy_variation12.phpt file_get_contents_basic.phpt file_get_contents_error.phpt fscanf_variation51.phpt fscanf_variation52.p
zoe Thu Apr 16 12:14:38 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/filefile_get_contents_error.phpt mkdir_rmdir_variation2.phpt 005_variation.phpt fscanf_variation53.phpt rename_variation8.phpt fscanf_variation52.phpt is_dir_variation2.phpt fscanf_variation51.phpt is_dir_variation1.phpt rename_variation.phpt rename_variation4.phpt rename_variation3.phpt rename_variation2.phpt rename_variation1.phpt rename_basic.phpt readlink_realpath_variation3.phpt copy_variation12.phpt is_file_error.phpt symlink_link_linkinfo_is_link_basic2.phpt symlink_link_linkinfo_is_link_variation6.phpt file_get_contents_basic.phpt Log: fixing incorrect --CLEAN-- sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file_get_contents_error.phpt?r1=1.1.4.2&r2=1.1.4.3&diff_format=u Index: php-src/ext/standard/tests/file/file_get_contents_error.phpt diff -u php-src/ext/standard/tests/file/file_get_contents_error.phpt:1.1.4.2 php-src/ext/standard/tests/file/file_get_contents_error.phpt:1.1.4.3 --- php-src/ext/standard/tests/file/file_get_contents_error.phpt:1.1.4.2 Wed Nov 26 10:10:17 2008 +++ php-src/ext/standard/tests/file/file_get_contents_error.phptThu Apr 16 12:14:38 2009 @@ -38,9 +38,12 @@ --CLEAN-- --EXPECTF-- *** Testing error conditions *** @@ -61,4 +64,4 @@ Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d bool(false) -*** Done *** \ No newline at end of file +*** Done *** http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt?r1=1.1.2.2.2.2&r2=1.1.2.2.2.3&diff_format=u Index: php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt diff -u php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt:1.1.2.2.2.2 php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt:1.1.2.2.2.3 --- php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt:1.1.2.2.2.2 Fri Dec 12 12:44:48 2008 +++ php-src/ext/standard/tests/file/mkdir_rmdir_variation2.phpt Thu Apr 16 12:14:38 2009 @@ -50,7 +50,6 @@ --CLEAN-- --EXPECTF-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_variation.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: php-src/ext/standard/tests/file/005_variation.phpt diff -u php-src/ext/standard/tests/file/005_variation.phpt:1.1.2.1 php-src/ext/standard/tests/file/005_variation.phpt:1.1.2.1.2.1 --- php-src/ext/standard/tests/file/005_variation.phpt:1.1.2.1 Mon Jun 11 16:14:59 2007 +++ php-src/ext/standard/tests/file/005_variation.phpt Thu Apr 16 12:14:38 2009 @@ -156,13 +156,27 @@ --CLEAN-- --EXPECTF-- *** Testing fileattime(), filemtime(), filectime() & touch() : usage variations *** http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fscanf_variation53.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/file/fscanf_variation53.phpt diff -u php-src/ext/standard/tests/file/fscanf_variation53.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/file/fscanf_variation53.phpt:1.1.2.1.2.2 --- php-src/ext/standard/tests/file/fscanf_variation53.phpt:1.1.2.1.2.1 Mon Nov 5 17:43:20 2007 +++ php-src/ext/standard/tests/file/fscanf_variation53.phpt Thu Apr 16 12:14:38 2009 @@ -74,7 +74,9 @@ --EXPECT-- *** Test fscanf(): to read a file when file pointer is pointing to EOF *** http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/rename_variation8.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: php-src/ext/standard/tests/file/rename_variation8.phpt diff -u php-src/ext/standard/tests/file/rename_variation8.phpt:1.2.2.2 php-src/ext/standard/tests/file/rename_variation8.phpt:1.2.2.3 --- php-src/ext/standard/tests/file/rename_variation8.phpt:1.2.2.2 Wed Apr 30 13:53:52 2008 +++ php-src/ext/standard/tests/file/rename_variation8.phpt Thu Apr 16 12:14:38 2009 @@ -41,7 +41,6 @@ ?> --CLEAN-- --EXPECTF-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fscanf_variation52.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/file/fscanf_variation52.phpt diff -u php-src/ext/standard/tests/file/fscanf_variatio
Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard filters.c http_fopen_wrapper.c /ext/standard/tests/filters chunked_001.phpt
Hannes Magnusson wrote: On Thu, Apr 16, 2009 at 12:16, Dmitry Stogov wrote: dmitry Thu Apr 16 10:16:27 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/filters chunked_001.phpt Modified files: /php-srcNEWS /php-src/ext/standard filters.c http_fopen_wrapper.c Log: - Added "dechunk" filter which can decode HTTP responces with chunked transfer-encoding. HTTP streams use this filter automatically in case "Transfer-Encoding: chunked" header presents in responce. It's possible to disable this behaviour using "http"=>array("auto_decode"=>0) in stream context - Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked") Although its great that this is implemented as a filter I'm a bit sceptical on removing the header from the response, and enabling this by default is quite a big change considering PHP has never supported chunked encoding and bunch of userland implementations exist for it. -Hannes The header needs to be taken out so the caller knows that the content is no longer chunked. It would however be nice if some header was added indicating that the data had been chunked. Similar to how ext/http does it where it changes the Transfer-Encoding header to X-Original-Transfer-Encoding. Rob -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/array count_recursive.phpt end.phpt
zoe Thu Apr 16 10:54:45 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/array count_recursive.phpt end.phpt Log: fixing incorrect --CLEAN-- sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/count_recursive.phpt?r1=1.4.8.1&r2=1.4.8.2&diff_format=u Index: php-src/ext/standard/tests/array/count_recursive.phpt diff -u php-src/ext/standard/tests/array/count_recursive.phpt:1.4.8.1 php-src/ext/standard/tests/array/count_recursive.phpt:1.4.8.2 --- php-src/ext/standard/tests/array/count_recursive.phpt:1.4.8.1 Fri Nov 2 19:41:11 2007 +++ php-src/ext/standard/tests/array/count_recursive.phpt Thu Apr 16 10:54:45 2009 @@ -125,7 +125,6 @@ echo "\nDone"; ---CLEAN-- /* closing the resource handles */ fclose( $resource1 ); closedir( $resource2 ); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/end.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u Index: php-src/ext/standard/tests/array/end.phpt diff -u php-src/ext/standard/tests/array/end.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/array/end.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/array/end.phpt:1.1.2.2.2.1 Fri Nov 2 19:41:11 2007 +++ php-src/ext/standard/tests/array/end.phpt Thu Apr 16 10:54:45 2009 @@ -123,13 +123,12 @@ echo "Done\n"; -?> ---CLEAN-- /* cleaning resource handles */ fclose( $file_handle ); //file resource handle deleted closedir( $dir_handle ); //dir resource handle deleted +?> --EXPECTF-- *** Testing end() on different arrays *** -- Iteration 1 -- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/general_functions bug44394_2.phpt is_array.phpt is_bool.phpt is_float.phpt is_int.phpt is_null.phpt is_numeric.phpt is_object.phpt is_scalar.phpt is
zoe Thu Apr 16 10:52:48 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/general_functions is_bool.phpt is_array.phpt is_null.phpt strval.phpt bug44394_2.phpt is_string.phpt is_object.phpt is_int.phpt is_numeric.phpt is_scalar.phpt is_float.phpt Log: fixing incorrect --CLEAN-- sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_bool.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/general_functions/is_bool.phpt diff -u php-src/ext/standard/tests/general_functions/is_bool.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/general_functions/is_bool.phpt:1.1.2.1.2.2 --- php-src/ext/standard/tests/general_functions/is_bool.phpt:1.1.2.1.2.1 Fri Jun 20 13:02:33 2008 +++ php-src/ext/standard/tests/general_functions/is_bool.phpt Thu Apr 16 10:52:47 2009 @@ -135,13 +135,12 @@ var_dump( is_bool(TRUE, FALSE) ); echo "Done\n"; -?> ---CLEAN-- // close resources fclose($fp); closedir($dfp); +?> --EXPECTF-- *** Testing is_bool() with valid boolean values *** -- Iteration 1 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_array.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/general_functions/is_array.phpt diff -u php-src/ext/standard/tests/general_functions/is_array.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/general_functions/is_array.phpt:1.1.2.1.2.2 --- php-src/ext/standard/tests/general_functions/is_array.phpt:1.1.2.1.2.1 Fri Jun 20 13:02:33 2008 +++ php-src/ext/standard/tests/general_functions/is_array.phpt Thu Apr 16 10:52:47 2009 @@ -106,12 +106,10 @@ var_dump( is_array ($fp, $fp) ); echo "Done\n"; -?> ---CLEAN-- /* close resources */ fclose($fp); closedir($dfp); - +?> --EXPECTF-- *** Testing is_array() on different type of arrays *** -- Iteration 1 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_null.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/general_functions/is_null.phpt diff -u php-src/ext/standard/tests/general_functions/is_null.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/general_functions/is_null.phpt:1.1.2.1.2.2 --- php-src/ext/standard/tests/general_functions/is_null.phpt:1.1.2.1.2.1 Fri Jun 20 13:02:33 2008 +++ php-src/ext/standard/tests/general_functions/is_null.phpt Thu Apr 16 10:52:47 2009 @@ -135,13 +135,12 @@ var_dump( is_null(NULL, null) ); echo "Done\n"; -?> ---CLEAN-- // close the resources used fclose($fp); closedir($dfp); +?> --EXPECTF-- *** Testing is_null() with valid null values *** -- Iteration 1 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/strval.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u Index: php-src/ext/standard/tests/general_functions/strval.phpt diff -u php-src/ext/standard/tests/general_functions/strval.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/general_functions/strval.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/general_functions/strval.phpt:1.1.2.2.2.1 Fri Jun 20 14:53:57 2008 +++ php-src/ext/standard/tests/general_functions/strval.phptThu Apr 16 10:52:47 2009 @@ -149,13 +149,12 @@ var_dump( strval( $scalars[0], $scalars[1]) ); echo "Done\n"; -?> ---CLEAN-- // close the resources used fclose($fp); closedir($dfp); +?> --EXPECTF-- *** Testing str_val() with scalar values*** -- Iteration 1 -- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44394_2.phpt?r1=1.1.2.5&r2=1.1.2.6&diff_format=u Index: php-src/ext/standard/tests/general_functions/bug44394_2.phpt diff -u php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.5 php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.6 --- php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.5 Thu Aug 21 10:30:49 2008 +++ php-src/ext/standard/tests/general_functions/bug44394_2.phptThu Apr 16 10:52:47 2009 @@ -26,7 +26,6 @@ ?> --CLEAN-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_string.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/general_functions/is_string.phpt diff -u php-src/ext/standard/tests/general_functions/is_string.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/general_functions/is_string.phpt:1.1.2.1.2.2 --- php-src
Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard filters.c http_fopen_wrapper.c /ext/standard/tests/filters chunked_001.phpt
On Thu, Apr 16, 2009 at 12:16, Dmitry Stogov wrote: > dmitry Thu Apr 16 10:16:27 2009 UTC > > Added files: (Branch: PHP_5_3) > /php-src/ext/standard/tests/filters chunked_001.phpt > > Modified files: > /php-src NEWS > /php-src/ext/standard filters.c http_fopen_wrapper.c > Log: > - Added "dechunk" filter which can decode HTTP responces with chunked > transfer-encoding. HTTP streams use this filter automatically in case > "Transfer-Encoding: chunked" header presents in responce. It's possible to > disable this behaviour using "http"=>array("auto_decode"=>0) in stream context > - Fixed bug #47021 (SoapClient stumbles over WSDL delivered with > "Transfer-Encoding: chunked") Although its great that this is implemented as a filter I'm a bit sceptical on removing the header from the response, and enabling this by default is quite a big change considering PHP has never supported chunked encoding and bunch of userland implementations exist for it. -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard filters.c http_fopen_wrapper.c /ext/standard/tests/filters chunked_001.phpt
dmitry Thu Apr 16 10:34:15 2009 UTC Modified files: /php-src/ext/standard filters.c http_fopen_wrapper.c /php-src/ext/standard/tests/filters chunked_001.phpt Log: - Added "dechunk" filter which can decode HTTP responces with chunked transfer-encoding. HTTP streams use this filter automatically in case "Transfer-Encoding: chunked" header presents in responce. It's possible to disable this behaviour using "http"=>array("auto_decode"=>0) in stream context - Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked") http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filters.c?r1=1.63&r2=1.64&diff_format=u Index: php-src/ext/standard/filters.c diff -u php-src/ext/standard/filters.c:1.63 php-src/ext/standard/filters.c:1.64 --- php-src/ext/standard/filters.c:1.63 Tue Mar 10 23:39:39 2009 +++ php-src/ext/standard/filters.c Thu Apr 16 10:34:15 2009 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: filters.c,v 1.63 2009/03/10 23:39:39 helly Exp $ */ +/* $Id: filters.c,v 1.64 2009/04/16 10:34:15 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -1978,6 +1978,225 @@ /* }}} */ +/* {{{ chunked filter implementation */ +typedef enum _php_chunked_filter_state { + CHUNK_SIZE_START, + CHUNK_SIZE, + CHUNK_SIZE_EXT_START, + CHUNK_SIZE_EXT, + CHUNK_SIZE_CR, + CHUNK_SIZE_LF, + CHUNK_BODY, + CHUNK_BODY_CR, + CHUNK_BODY_LF, + CHUNK_TRAILER, + CHUNK_ERROR +} php_chunked_filter_state; + +typedef struct _php_chunked_filter_data { + php_chunked_filter_state state; + int chunk_size; + int persistent; +} php_chunked_filter_data; + +static int php_dechunk(char *buf, int len, php_chunked_filter_data *data) +{ + char *p = buf; + char *end = p + len; + char *out = buf; + int out_len = 0; + + while (p < end) { + switch (data->state) { + case CHUNK_SIZE_START: + data->chunk_size = 0; + case CHUNK_SIZE: + while (p < end) { + if (*p >= '0' && *p <= '9') { + data->chunk_size = (data->chunk_size * 16) + (*p - '0'); + } else if (*p >= 'A' && *p <= 'F') { + data->chunk_size = (data->chunk_size * 16) + (*p - 'A' + 10); + } else if (*p >= 'a' && *p <= 'f') { + data->chunk_size = (data->chunk_size * 16) + (*p - 'a' + 10); + } else if (data->state == CHUNK_SIZE_START) { + data->state = CHUNK_ERROR; + break; + } else { + data->state = CHUNK_SIZE_EXT_START; + break; + } + data->state = CHUNK_SIZE; + p++; + } + if (data->state == CHUNK_ERROR) { + continue; + } else if (p == end) { + return out_len; + } + case CHUNK_SIZE_EXT_START: + if (*p == ';'|| *p == '\r' || *p == '\n') { + data->state = CHUNK_SIZE_EXT; + } else { + data->state = CHUNK_ERROR; + continue; + } + case CHUNK_SIZE_EXT: + /* skip extension */ + while (p < end && *p != '\r' && *p != '\n') { + p++; + } + if (p == end) { + return out_len; + } + case CHUNK_SIZE_CR: + if (*p == '\r') { + p++; + if (p == end) { + data->state = CHUNK_SIZE_LF; + return out_len; + } + } + case CHUNK_SIZE_LF: + if (*p == '\n') { + p++; +
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard filters.c http_fopen_wrapper.c /ext/standard/tests/filters chunked_001.phpt
dmitry Thu Apr 16 10:16:27 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/filters chunked_001.phpt Modified files: /php-srcNEWS /php-src/ext/standard filters.c http_fopen_wrapper.c Log: - Added "dechunk" filter which can decode HTTP responces with chunked transfer-encoding. HTTP streams use this filter automatically in case "Transfer-Encoding: chunked" header presents in responce. It's possible to disable this behaviour using "http"=>array("auto_decode"=>0) in stream context - Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked") http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.559&r2=1.2027.2.547.2.965.2.560&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.559 php-src/NEWS:1.2027.2.547.2.965.2.560 --- php-src/NEWS:1.2027.2.547.2.965.2.559 Thu Apr 16 06:47:36 2009 +++ php-src/NEWSThu Apr 16 10:16:26 2009 @@ -6,6 +6,11 @@ - Upgraded bundled PCRE to version 7.9. (Nuno) - Added 'n' flag to fopen to allow passing O_NONBLOCK to the underlying open(2) system call. (Mikko) +- Added "dechunk" filter which can decode HTTP responces with chunked + transfer-encoding. HTTP streams use this filter automatically in case + "Transfer-Encoding: chunked" header presents in responce. It's possible to + disable this behaviour using "http"=>array("auto_decode"=>0) in stream + context. (Dmitry) - Fixed bug #47880 (crashes in call_user_func_array()). (Dmitry) - Fixed bug #47856 (stristr() converts needle to lower-case). (Ilia) @@ -28,6 +33,8 @@ - Fixed bug #47516 (nowdoc can not be embed in heredoc but can be embed in double quote). (Dmitry) - Fixed bug #47038 (Memory leak in include). (Dmitry) +- Fixed bug #47021 (SoapClient stumbles over WSDL delivered with + "Transfer-Encoding: chunked"). (Dmitry) - Fixed bug #46108 (DateTime - Memory leak when unserializing). (Felipe) - Fixed bug #44861 (scrollable cursor don't work with pgsql). (Matteo) - Fixed bug #44409 (PDO::FETCH_SERIALIZE calls __construct()). (Matteo) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filters.c?r1=1.44.2.6.2.4.2.3&r2=1.44.2.6.2.4.2.4&diff_format=u Index: php-src/ext/standard/filters.c diff -u php-src/ext/standard/filters.c:1.44.2.6.2.4.2.3 php-src/ext/standard/filters.c:1.44.2.6.2.4.2.4 --- php-src/ext/standard/filters.c:1.44.2.6.2.4.2.3 Wed Dec 31 11:15:45 2008 +++ php-src/ext/standard/filters.c Thu Apr 16 10:16:27 2009 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: filters.c,v 1.44.2.6.2.4.2.3 2008/12/31 11:15:45 sebastian Exp $ */ +/* $Id: filters.c,v 1.44.2.6.2.4.2.4 2009/04/16 10:16:27 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -1897,6 +1897,220 @@ /* }}} */ +/* {{{ chunked filter implementation */ +typedef enum _php_chunked_filter_state { + CHUNK_SIZE_START, + CHUNK_SIZE, + CHUNK_SIZE_EXT_START, + CHUNK_SIZE_EXT, + CHUNK_SIZE_CR, + CHUNK_SIZE_LF, + CHUNK_BODY, + CHUNK_BODY_CR, + CHUNK_BODY_LF, + CHUNK_TRAILER, + CHUNK_ERROR +} php_chunked_filter_state; + +typedef struct _php_chunked_filter_data { + php_chunked_filter_state state; + int chunk_size; + int persistent; +} php_chunked_filter_data; + +static int php_dechunk(char *buf, int len, php_chunked_filter_data *data) +{ + char *p = buf; + char *end = p + len; + char *out = buf; + int out_len = 0; + + while (p < end) { + switch (data->state) { + case CHUNK_SIZE_START: + data->chunk_size = 0; + case CHUNK_SIZE: + while (p < end) { + if (*p >= '0' && *p <= '9') { + data->chunk_size = (data->chunk_size * 16) + (*p - '0'); + } else if (*p >= 'A' && *p <= 'F') { + data->chunk_size = (data->chunk_size * 16) + (*p - 'A' + 10); + } else if (*p >= 'a' && *p <= 'f') { + data->chunk_size = (data->chunk_size * 16) + (*p - 'a' + 10); + } else if (data->state == CHUNK_SIZE_START) { + data->state = CHUNK_ERROR; + break; + } else { + data->state = CHUNK_SIZE_EXT_START; + break; + } + data->state = CHUNK_SIZE; + p++; +
[PHP-CVS] cvs: CVSROOT / avail
derick Thu Apr 16 09:57:08 2009 UTC Modified files: /CVSROOTavail Log: - Give Stefan phpruntests access as well. http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1516&r2=1.1517&diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1516 CVSROOT/avail:1.1517 --- CVSROOT/avail:1.1516Wed Apr 15 16:32:36 2009 +++ CVSROOT/avail Thu Apr 16 09:57:08 2009 @@ -363,7 +363,7 @@ avail|olafurw,nlopess,pbiggar|php-benchmarks # phpruntests karma -avail|zoe|phpruntests +avail|zoe,spriebsch|phpruntests # SVN conversion repo avail|gwynne|SVNROOT -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/curl interface.c
pajoye Thu Apr 16 09:47:33 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/curl interface.c Log: - disable file:// when safe_mode or open_basedir are enabled http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.43&r2=1.62.2.14.2.44&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.43 php-src/ext/curl/interface.c:1.62.2.14.2.44 --- php-src/ext/curl/interface.c:1.62.2.14.2.43 Mon Mar 16 15:09:51 2009 +++ php-src/ext/curl/interface.cThu Apr 16 09:47:33 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.43 2009/03/16 15:09:51 felipe Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.44 2009/04/16 09:47:33 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -162,31 +162,43 @@ #define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len, __ret) \ - if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \ - strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \ - { \ - php_url *tmp_url; \ - \ - if (!(tmp_url = php_url_parse_ex(str, len))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->host || !php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters", str); \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \ - (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \ - ) { \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - php_url_free(tmp_url); \ +static int php_curl_option_url(php_curl *ch, const char *url, const int len) { + CURLcode error=CURLE_OK; +#if LIBCURL_VERSION_NUM < 0x071100 + char *copystr = NULL; +#endif + + /* Disable file:// if open_basedir or safe_mode are used */ + if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { +#if LIBCURL_VERSION_NUM >= 0x071304 + error = curl_easy_setopt(ch->cp, CURLOPT_PROTO