RE: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c
Hi Ilia, Why do you completely break ext/soap (all tests are failed)? Why do you do it in PHP_5_2 branch? (we have HEAD for experiments) Your patch doesn't allow me to fix other ext/soap issues, because it completely breaks test suite. Please finish your fix ASAP (also for HEAD) or revert it. Thanks. Dmitry. -Original Message- From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] Sent: Sunday, May 06, 2007 9:21 PM To: php-cvs@lists.php.net Subject: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c iliaa Sun May 6 17:21:13 2007 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/ext/soap soap.c Log: Allow SOAP extension's handler() to work even when always_populate_raw_post_data is off. # Tests will be updated in the next few days http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.6 85r2=1.2027.2.547.2.686diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.685 php-src/NEWS:1.2027.2.547.2.686 --- php-src/NEWS:1.2027.2.547.2.685 Sun May 6 16:34:14 2007 +++ php-src/NEWS Sun May 6 17:21:13 2007 @@ -1,6 +1,8 @@ PHP NEWS || | ?? ??? 2007, PHP 5.2.3 +- Allow SOAP extension's handler() to work even when + always_populate_raw_post_data is off. (Ilia) - Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser) (Ilia) - Fixed altering $this via argument named this. (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156 .2.28.2.23r2=1.156.2.28.2.24diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.23 php-src/ext/soap/soap.c:1.156.2.28.2.24 --- php-src/ext/soap/soap.c:1.156.2.28.2.23 Wed May 2 08:22:13 2007 +++ php-src/ext/soap/soap.c Sun May 6 17:21:13 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +- -+ */ -/* $Id: soap.c,v 1.156.2.28.2.23 2007/05/02 08:22:13 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.24 2007/05/06 17:21:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -140,8 +140,6 @@ SOAP_GLOBAL(soap_version) = _old_soap_version; #endif -#define HTTP_RAW_POST_DATA HTTP_RAW_POST_DATA - #define ZERO_PARAM() \ if (ZEND_NUM_ARGS() != 0) \ WRONG_PARAM_COUNT; @@ -1403,7 +1401,7 @@ sdlPtr old_sdl = NULL; soapServicePtr service; xmlDocPtr doc_request=NULL, doc_return; - zval function_name, **params, **raw_post, *soap_obj, retval; + zval function_name, **params, *soap_obj, retval; char *fn_name, cont_len[30]; int num_params = 0, size, i, call_status = 0; xmlChar *buf; @@ -1478,8 +1476,9 @@ } if (ZEND_NUM_ARGS() == 0) { - if (zend_hash_find(EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) raw_post)!=FAILURE - ((*raw_post)-type==IS_STRING)) { + 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; zval **server_vars, **encoding; zend_is_auto_global(_SERVER, sizeof(_SERVER)-1 TSRMLS_CC); @@ -1497,13 +1496,13 @@ zend_hash_exists(EG(function_table), gzinflate, sizeof(gzinflate))) { ZVAL_STRING(func, gzinflate, 0); params[0] = param; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post)+10, Z_STRLEN_PP(raw_post)-10, 0); + 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] = param; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post), Z_STRLEN_PP(raw_post), 0); + ZVAL_STRINGL(params[0], post_data, post_data_length, 0); INIT_PZVAL(params[0]); } else { php_error_docref(NULL TSRMLS_CC, E_ERROR,Request is compressed with unknown compression '%s',Z_STRVAL_PP(encoding)); @@ -1516,16 +1515,9 @@
Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c
On 7-May-07, at 4:19 AM, Dmitry Stogov wrote: Hi Ilia, Why do you completely break ext/soap (all tests are failed)? The soap is hardly broken, what the patch changed was allow SoapServer's handle() method to work without any parameters even when always_populate_raw_post_data is off. However, because all your tests use a hack to HTTP_RAW_POST_DATA they broke. As I've said in the commit message I'll fix the tests in the next day or two. Ilia Alshanetsky -- 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_2) / NEWS /ext/soap soap.c
Dmitry, All of the tests have been fixed and now pass. I've had to convert the gzip/deflate tests to use CGI and added an additional test to check basic POST retrieval from a request (server029). On 7-May-07, at 4:19 AM, Dmitry Stogov wrote: Hi Ilia, Why do you completely break ext/soap (all tests are failed)? Why do you do it in PHP_5_2 branch? (we have HEAD for experiments) Your patch doesn't allow me to fix other ext/soap issues, because it completely breaks test suite. Please finish your fix ASAP (also for HEAD) or revert it. Thanks. Dmitry. -Original Message- From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] Sent: Sunday, May 06, 2007 9:21 PM To: php-cvs@lists.php.net Subject: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c iliaa Sun May 6 17:21:13 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/soap soap.c Log: Allow SOAP extension's handler() to work even when always_populate_raw_post_data is off. # Tests will be updated in the next few days http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.6 85r2=1.2027.2.547.2.686diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.685 php-src/NEWS:1.2027.2.547.2.686 --- php-src/NEWS:1.2027.2.547.2.685 Sun May 6 16:34:14 2007 +++ php-src/NEWSSun May 6 17:21:13 2007 @@ -1,6 +1,8 @@ PHP NEWS || | ?? ??? 2007, PHP 5.2.3 +- Allow SOAP extension's handler() to work even when + always_populate_raw_post_data is off. (Ilia) - Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser) (Ilia) - Fixed altering $this via argument named this. (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156 .2.28.2.23r2=1.156.2.28.2.24diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.23 php-src/ext/soap/soap.c:1.156.2.28.2.24 --- php-src/ext/soap/soap.c:1.156.2.28.2.23 Wed May 2 08:22:13 2007 +++ php-src/ext/soap/soap.c Sun May 6 17:21:13 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +- -+ */ -/* $Id: soap.c,v 1.156.2.28.2.23 2007/05/02 08:22:13 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.24 2007/05/06 17:21:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -140,8 +140,6 @@ SOAP_GLOBAL(soap_version) = _old_soap_version; #endif -#define HTTP_RAW_POST_DATA HTTP_RAW_POST_DATA - #define ZERO_PARAM() \ if (ZEND_NUM_ARGS() != 0) \ WRONG_PARAM_COUNT; @@ -1403,7 +1401,7 @@ sdlPtr old_sdl = NULL; soapServicePtr service; xmlDocPtr doc_request=NULL, doc_return; - zval function_name, **params, **raw_post, *soap_obj, retval; + zval function_name, **params, *soap_obj, retval; char *fn_name, cont_len[30]; int num_params = 0, size, i, call_status = 0; xmlChar *buf; @@ -1478,8 +1476,9 @@ } if (ZEND_NUM_ARGS() == 0) { - if (zend_hash_find(EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) raw_post)!=FAILURE -((*raw_post)-type==IS_STRING)) { + 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; zval **server_vars, **encoding; zend_is_auto_global(_SERVER, sizeof(_SERVER)-1 TSRMLS_CC); @@ -1497,13 +1496,13 @@ zend_hash_exists(EG(function_table), gzinflate, sizeof(gzinflate))) { ZVAL_STRING(func, gzinflate, 0); params[0] = param; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post)+10, Z_STRLEN_PP(raw_post)-10, 0); + 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] = param; - ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post), Z_STRLEN_PP(raw_post), 0); + ZVAL_STRINGL(params[0], post_data, post_data_length, 0); INIT_PZVAL(params[0]); } else { php_error_docref(NULL TSRMLS_CC, E_ERROR,Request is compressed with unknown compression