[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /ext/soap/tests/bugs bug29109.phpt multiport.phpt multiport.wsdl
dmitry Wed Jun 18 07:24:14 2008 UTC Modified files: /php-src/ext/soap php_sdl.c /php-src/ext/soap/tests/bugsmultiport.phpt multiport.wsdl bug29109.phpt Log: Fixed SOAP binding selection http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.112r2=1.113diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.112 php-src/ext/soap/php_sdl.c:1.113 --- php-src/ext/soap/php_sdl.c:1.112Wed May 7 15:45:02 2008 +++ php-src/ext/soap/php_sdl.c Wed Jun 18 07:24:14 2008 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.112 2008/05/07 15:45:02 davidc Exp $ */ +/* $Id: php_sdl.c,v 1.113 2008/06/18 07:24:14 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -721,12 +721,12 @@ } trav2 = trav2-next; } - if (!address) { + if (!address || tmpbinding-bindingType == BINDING_HTTP) { if (has_soap_port || trav-next || i n-1) { efree(tmpbinding); trav = trav-next; continue; - } else { + } else if (!address) { soap_error0(E_ERROR, Parsing WSDL: No address associated with port); } } http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/multiport.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/multiport.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/multiport.phpt:1.2 --- /dev/null Wed Jun 18 07:24:14 2008 +++ php-src/ext/soap/tests/bugs/multiport.phpt Wed Jun 18 07:24:14 2008 @@ -0,0 +1,16 @@ +--TEST-- +Proper binding selection +--SKIPIF-- +?php require_once 'skipif.inc'; ? +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +?php +$client = new SoapClient(dirname(__FILE__).'/multiport.wsdl', + array('trace' = true, 'exceptions' = false)); +$response = $client-GetSessionId(array('userId'='user', 'password'='password')); +echo $client-__getLastRequest(); +? +--EXPECT-- +?xml version=1.0 encoding=UTF-8? +SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=http://www.reuters.com/;SOAP-ENV:Bodyns1:GetSessionIdns1:userIduser/ns1:userIdns1:passwordpassword/ns1:password/ns1:GetSessionId/SOAP-ENV:Body/SOAP-ENV:Envelope http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/multiport.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/multiport.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/multiport.wsdl:1.2 --- /dev/null Wed Jun 18 07:24:14 2008 +++ php-src/ext/soap/tests/bugs/multiport.wsdl Wed Jun 18 07:24:14 2008 @@ -0,0 +1,88 @@ +?xml version=1.0 encoding=UTF-8? +wsdl:definitions targetNamespace=http://www.reuters.com/; xmlns:tns=http://www.reuters.com/; xmlns:tm=http://microsoft.com/wsdl/mime/textMatching/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:s=http://www.w3.org/2001/XMLSchema; + wsdl:types +s:schema elementFormDefault=qualified targetNamespace=http://www.reuters.com/; + s:element name=GetSessionId +s:complexType + s:sequence +s:element maxOccurs=1 minOccurs=0 name=userId type=s:string/ +s:element maxOccurs=1 minOccurs=0 name=password type=s:string/ + /s:sequence +/s:complexType + /s:element + s:element name=GetSessionIdResponse +s:complexType + s:sequence +s:element maxOccurs=1 minOccurs=0 name=GetSessionIdResult type=s:string/ + /s:sequence +/s:complexType + /s:element +/s:schema + /wsdl:types + wsdl:message name=GetSessionIdHttpGetIn +wsdl:part name=userId type=s:string +/wsdl:part +wsdl:part name=password type=s:string +/wsdl:part + /wsdl:message + wsdl:message name=GetSessionIdHttpGetOut +wsdl:part name=Body element=tns:string +/wsdl:part + /wsdl:message + wsdl:message name=GetSessionIdSoapOut +wsdl:part name=parameters element=tns:GetSessionIdResponse +/wsdl:part + /wsdl:message + wsdl:message name=GetSessionIdSoapIn +wsdl:part name=parameters element=tns:GetSessionId +/wsdl:part + /wsdl:message + wsdl:portType name=StocksDataSecureHttpGet +wsdl:operation name=GetSessionId +
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
davidc Wed May 7 15:45:02 2008 UTC Modified files: /php-src/ext/soap php_sdl.c Log: - Fixed bug #44811 (Improve error message when creating new SoapClient that contains invalid data) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.111r2=1.112diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.111 php-src/ext/soap/php_sdl.c:1.112 --- php-src/ext/soap/php_sdl.c:1.111Mon Dec 31 07:12:14 2007 +++ php-src/ext/soap/php_sdl.c Wed May 7 15:45:02 2008 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.111 2007/12/31 07:12:14 sebastian Exp $ */ +/* $Id: php_sdl.c,v 1.112 2008/05/07 15:45:02 davidc Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -240,7 +240,12 @@ wsdl = soap_xmlParseFile(struri TSRMLS_CC); if (!wsdl) { - soap_error1(E_ERROR, Parsing WSDL: Couldn't load from '%s', struri); + xmlErrorPtr xmlErrorPtr = xmlGetLastError(); + if (xmlErrorPtr) { + soap_error2(E_ERROR, Parsing WSDL: Couldn't load from '%s' : %s, struri, xmlErrorPtr-message); + } else { + soap_error1(E_ERROR, Parsing WSDL: Couldn't load from '%s', struri); + } } zend_hash_add(ctx-docs, struri, strlen(struri)+1, (void**)wsdl, sizeof(xmlDocPtr), NULL); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Fri Nov 23 10:02:53 2007 UTC Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #42952 (soap cache file is created with insecure permissions) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.109r2=1.110diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.109 php-src/ext/soap/php_sdl.c:1.110 --- php-src/ext/soap/php_sdl.c:1.109Mon May 21 13:14:02 2007 +++ php-src/ext/soap/php_sdl.c Fri Nov 23 10:02:53 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.109 2007/05/21 13:14:02 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.110 2007/11/23 10:02:53 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -2015,7 +2015,7 @@ #ifdef ZEND_WIN32 f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE); #else - f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE|S_IROTH|S_IWOTH|S_IRGRP|S_IWGRP); + f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE); #endif if (f 0) {return;} @@ -3117,16 +3117,24 @@ unsigned char digest[16]; int len = strlen(SOAP_GLOBAL(cache_dir)); time_t cached; + char *user = php_get_current_user(); + int user_len = user ? strlen(user) + 1 : 0; md5str[0] = '\0'; PHP_MD5Init(context); PHP_MD5Update(context, (unsigned char*)uri, uri_len); PHP_MD5Final(digest, context); make_digest(md5str, digest); - key = emalloc(len+sizeof(/wsdl-)-1+sizeof(md5str)); + key = emalloc(len+sizeof(/wsdl-)-1+user_len+sizeof(md5str)); memcpy(key,SOAP_GLOBAL(cache_dir),len); memcpy(key+len,/wsdl-,sizeof(/wsdl-)-1); - memcpy(key+len+sizeof(/wsdl-)-1,md5str,sizeof(md5str)); + len += sizeof(/wsdl-)-1; + if (user_len) { + memcpy(key+len, user, user_len-1); + len += user_len-1; + key[len++] = '-'; + } + memcpy(key+len,md5str,sizeof(md5str)); if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), cached TSRMLS_CC)) != NULL) { t = cached; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /ext/soap/tests/bugs bug41337_2.phpt bug41337_2.wsdl bug41337_2_1.wsdl
dmitry Mon May 21 13:14:02 2007 UTC Modified files: /php-src/ext/soap php_sdl.c /php-src/ext/soap/tests/bugsbug41337_2.phpt bug41337_2.wsdl bug41337_2_1.wsdl Log: Fixed bug #41337 WSDL parsing doesn't ignore non soap bindings http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.108r2=1.109diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.108 php-src/ext/soap/php_sdl.c:1.109 --- php-src/ext/soap/php_sdl.c:1.108Thu May 10 14:58:31 2007 +++ php-src/ext/soap/php_sdl.c Mon May 21 13:14:02 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.108 2007/05/10 14:58:31 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.109 2007/05/21 13:14:02 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -717,7 +717,7 @@ trav2 = trav2-next; } if (!address) { - if (has_soap_port || trav-next) { + if (has_soap_port || trav-next || i n-1) { efree(tmpbinding); trav = trav-next; continue; http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41337_2.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug41337_2.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug41337_2.phpt:1.2 --- /dev/null Mon May 21 13:14:02 2007 +++ php-src/ext/soap/tests/bugs/bug41337_2.phpt Mon May 21 13:14:02 2007 @@ -0,0 +1,12 @@ +--TEST-- +Bug #41337 (WSDL parsing doesn't ignore non soap bindings) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +ini_set(soap.wsdl_cache_enabled,0); +$client = new SoapClient(dirname(__FILE__)./bug41337_2.wsdl); +echo ok\n; +? +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41337_2.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug41337_2.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug41337_2.wsdl:1.2 --- /dev/null Mon May 21 13:14:02 2007 +++ php-src/ext/soap/tests/bugs/bug41337_2.wsdl Mon May 21 13:14:02 2007 @@ -0,0 +1,36 @@ +?xml version=1.0 ? +definitions +xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; +xmlns:xsd=http://www.w3.org/2001/XMLSchema; +xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; +xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; +xmlns:si=http://soapinterop.org/xsd; +xmlns:tns=http://linuxsrv.home/~dmitry/soap/test.wsdl; +xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; +xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; +xmlns=http://schemas.xmlsoap.org/wsdl/; +targetNamespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + + import namespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + location=bug41337_2_1.wsdl / + + binding name=TestServiceBinding type=tns:TestServicePortType +soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http; / +operation name=Add + soap:operation soapAction=Add style=rpc / + input +soap:body use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; / + /input + output +soap:body use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; / + /output +/operation + /binding + + service name=TestService +port name=TestServicePort binding=tns:TestServiceBinding + soap:address location=http://linuxsrv.home/~dmitry/soap/soap_server.php; / +/port + /service + +/definitions http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41337_2_1.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug41337_2_1.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug41337_2_1.wsdl:1.2 --- /dev/null Mon May 21 13:14:02 2007 +++ php-src/ext/soap/tests/bugs/bug41337_2_1.wsdl Mon May 21 13:14:02 2007 @@ -0,0 +1,47 @@ +?xml version=1.0 ? +definitions +xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; +xmlns:xsd=http://www.w3.org/2001/XMLSchema; +xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; +xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; +xmlns:si=http://soapinterop.org/xsd; +xmlns:tns=http://linuxsrv.home/~dmitry/soap/test.wsdl; +xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; +xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; +xmlns=http://schemas.xmlsoap.org/wsdl/; +targetNamespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + + types +xsd:schema targetNamespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + xsd:import namespace=http://schemas.xmlsoap.org/soap/encoding/; / + xsd:import
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /ext/soap/tests/bugs bug41337.phpt bug41337.wsdl
dmitry Thu May 10 14:58:32 2007 UTC Modified files: /php-src/ext/soap php_sdl.c /php-src/ext/soap/tests/bugsbug41337.phpt bug41337.wsdl Log: Fixed bug #41337 (WSDL parsing doesn't ignore non soap bindings) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.107r2=1.108diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.107 php-src/ext/soap/php_sdl.c:1.108 --- php-src/ext/soap/php_sdl.c:1.107Mon Jan 1 09:29:29 2007 +++ php-src/ext/soap/php_sdl.c Thu May 10 14:58:31 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.107 2007/01/01 09:29:29 sebastian Exp $ */ +/* $Id: php_sdl.c,v 1.108 2007/05/10 14:58:31 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -654,6 +654,7 @@ for (i = 0; i n; i++) { xmlNodePtr *tmp, service; xmlNodePtr trav, port; + int has_soap_port = 0; zend_hash_get_current_data(ctx.services, (void **)tmp); service = *tmp; @@ -716,8 +717,15 @@ trav2 = trav2-next; } if (!address) { - soap_error0(E_ERROR, Parsing WSDL: No address associated with port); + if (has_soap_port || trav-next) { + efree(tmpbinding); + trav = trav-next; + continue; + } else { + soap_error0(E_ERROR, Parsing WSDL: No address associated with port); + } } + has_soap_port = 1; location = get_attribute(address-properties, location); if (!location) { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41337.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug41337.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug41337.phpt:1.2 --- /dev/null Thu May 10 14:58:32 2007 +++ php-src/ext/soap/tests/bugs/bug41337.phpt Thu May 10 14:58:32 2007 @@ -0,0 +1,12 @@ +--TEST-- +Bug #41337 (WSDL parsing doesn't ignore non soap bindings) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +ini_set(soap.wsdl_cache_enabled,0); +$client = new SoapClient(dirname(__FILE__)./bug41337.wsdl); +echo ok\n; +? +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug41337.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug41337.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug41337.wsdl:1.2 --- /dev/null Thu May 10 14:58:32 2007 +++ php-src/ext/soap/tests/bugs/bug41337.wsdl Thu May 10 14:58:32 2007 @@ -0,0 +1,63 @@ +?xml version=1.0 ? +definitions +xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; +xmlns:xsd=http://www.w3.org/2001/XMLSchema; +xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; +xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; +xmlns:si=http://soapinterop.org/xsd; +xmlns:tns=http://linuxsrv.home/~dmitry/soap/test.wsdl; +xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; +xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; +xmlns=http://schemas.xmlsoap.org/wsdl/; +targetNamespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + + types +xsd:schema targetNamespace=http://linuxsrv.home/~dmitry/soap/test.wsdl; + xsd:import namespace=http://schemas.xmlsoap.org/soap/encoding/; / + xsd:import namespace=http://schemas.xmlsoap.org/wsdl/; / +/xsd:schema + /types + + message name=AddRequest +part name=x type=xsd:double / +part name=y type=xsd:double / + /message + message name=AddResponse +part name=result type=xsd:double / + /message + + portType name=TestServicePortType +operation name=Add + input message=tns:AddRequest / + output message=tns:AddResponse / +/operation + /portType + + binding name=TestServiceBinding2 type=tns:TestServicePortType +operation name=Add + input/ + output/ +/operation + /binding + + binding name=TestServiceBinding type=tns:TestServicePortType +soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http; / +operation name=Add + soap:operation soapAction=Add style=rpc / + input +soap:body use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; / + /input + output +soap:body use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; / + /output +/operation +
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
iliaa Thu Dec 21 01:16:36 2006 UTC Modified files: /php-src/ext/soap php_sdl.c Log: MFB: Optimize out zend_hash_num_elements() call http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.105r2=1.106diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.105 php-src/ext/soap/php_sdl.c:1.106 --- php-src/ext/soap/php_sdl.c:1.105Wed Sep 20 13:43:04 2006 +++ php-src/ext/soap/php_sdl.c Thu Dec 21 01:16:36 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.105 2006/09/20 13:43:04 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.106 2006/12/21 01:16:36 iliaa Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -1862,8 +1862,8 @@ if (i 0) { sdlTypePtr *tmp; - tmp_elements = emalloc(sizeof(HashTable)); - zend_hash_init(tmp_elements, 0, NULL, NULL, 0); + tmp_elements = emalloc(sizeof(HashTable)); + zend_hash_init(tmp_elements, i, NULL, NULL, 0); zend_hash_internal_pointer_reset(type-elements); while (zend_hash_get_current_data(type-elements, (void**)tmp) == SUCCESS) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Jun 26 13:31:37 2006 UTC Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #37862 (Integer pointer comparison to numeric value) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_sdl.c?r1=1.100r2=1.101diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.100 php-src/ext/soap/php_sdl.c:1.101 --- php-src/ext/soap/php_sdl.c:1.100Wed Apr 19 10:49:16 2006 +++ php-src/ext/soap/php_sdl.c Mon Jun 26 13:31:37 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.100 2006/04/19 10:49:16 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.101 2006/06/26 13:31:37 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -2193,7 +2193,7 @@ zend_hash_find(tmp_bindings,(char*)(*tmp)-binding,sizeof((*tmp)-binding), (void**)binding_num) != SUCCESS) { } WSDL_CACHE_PUT_INT(*binding_num, out); - if (binding_num = 0) { + if (*binding_num = 0) { if ((*tmp)-binding-bindingType == BINDING_SOAP (*tmp)-bindingAttributes != NULL) { sdlSoapBindingFunctionPtr binding = (sdlSoapBindingFunctionPtr)(*tmp)-bindingAttributes; WSDL_CACHE_PUT_1(binding-style, out); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c php_sdl.h php_soap.h soap.c /ext/soap/tests/bugs bug37083.phpt
dmitry Wed Apr 19 10:49:16 2006 UTC Modified files: /php-src/ext/soap php_sdl.c php_sdl.h php_soap.h soap.c /php-src/ext/soap/tests/bugsbug37083.phpt Log: Cleaned up Andrei's patch for caching WSDL in process memory, added TTL and LIMIT for memory cache. Memory cache is disblead by fefault because it is experemental and isn't tested enough. It can be enabled whit configuartion directive soap.wsdl_cache = WSDL_CACHE_MEMORY or soap.wsdl_cache = WSDL_CACHE_BOTH or derectly in SoapClent/Soa pServer constructor: $ws = new SoapClient($wsdl, array(cache_wsdl=WSDL_CACHE_BOTH)) Disk and memory caches use the same TTL value - soap.wsdl_cache_ttl. Configuration directive soap.wsdl_cache_limit restricts the number of cached w sdl files in memory. Adding new files into full memory cache will delete oldest files from it. Note that, each PHP process or thread uses it's own memory cache. http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_sdl.c?r1=1.99r2=1.100diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.99 php-src/ext/soap/php_sdl.c:1.100 --- php-src/ext/soap/php_sdl.c:1.99 Tue Apr 18 13:08:11 2006 +++ php-src/ext/soap/php_sdl.c Wed Apr 19 10:49:16 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.99 2006/04/18 13:08:11 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.100 2006/04/19 10:49:16 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -1417,7 +1417,7 @@ return ht; } -static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t TSRMLS_DC) +static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached TSRMLS_DC) { sdlPtr sdl; time_t old_t; @@ -1461,6 +1461,7 @@ efree(buf); return NULL; } + *cached = old_t; WSDL_CACHE_GET_INT(i, in); if (i == 0 strncmp(in, uri, i) != 0) { @@ -3027,29 +3028,109 @@ return psdl; } -sdlPtr get_sdl(zval *this_ptr, char *uri, zend_bool persistent TSRMLS_DC) +typedef struct _sdl_cache_bucket { + sdlPtr sdl; + time_t time; +} sdl_cache_bucket; + +static void delete_psdl(void *data) +{ + sdl_cache_bucket *p = (sdl_cache_bucket*)data; + sdlPtr tmp = p-sdl; + + zend_hash_destroy(tmp-functions); + if (tmp-source) { + free(tmp-source); + } + if (tmp-target_ns) { + free(tmp-target_ns); + } + if (tmp-elements) { + zend_hash_destroy(tmp-elements); + free(tmp-elements); + } + if (tmp-encoders) { + zend_hash_destroy(tmp-encoders); + free(tmp-encoders); + } + if (tmp-types) { + zend_hash_destroy(tmp-types); + free(tmp-types); + } + if (tmp-groups) { + zend_hash_destroy(tmp-groups); + free(tmp-groups); + } + if (tmp-bindings) { + zend_hash_destroy(tmp-bindings); + free(tmp-bindings); + } + if (tmp-requests) { + zend_hash_destroy(tmp-requests); + free(tmp-requests); + } + free(tmp); +} + +sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) { + char fn[MAXPATHLEN]; sdlPtr sdl = NULL; char* old_error_code = SOAP_GLOBAL(error_code); - int uri_len; + int uri_len = 0; php_stream_context *context=NULL; zval **tmp, **proxy_host, **proxy_port, *orig_context = NULL, *new_context = NULL; smart_str headers = {0}; - char *pkey = NULL; - int plen; + char* key = NULL; + time_t t = time(0); + + if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) { + uri_len = strlen(uri); + } else if (VCWD_REALPATH(uri, fn) == NULL) { + cache_wsdl = WSDL_CACHE_NONE; + } else { + uri = fn; + uri_len = strlen(uri); + } - if (persistent) { - zend_rsrc_list_entry *le_ptr; + if ((cache_wsdl WSDL_CACHE_MEMORY) SOAP_GLOBAL(mem_cache)) { + sdl_cache_bucket *p; - plen = spprintf(pkey, 0, SOAP:WSDL:%s, uri); - if (SUCCESS == zend_hash_find(EG(persistent_list), pkey, plen+1, (void*)le_ptr)) { - if (Z_TYPE_P(le_ptr) == php_soap_psdl_list_entry()) { - efree(pkey); - return (sdlPtr)le_ptr-ptr; + if (SUCCESS == zend_hash_find(SOAP_GLOBAL(mem_cache), uri, uri_len+1, (void*)p)) { + if (p-time t - SOAP_GLOBAL(cache_ttl)) { + /* in-memory cache entry is expired */ +
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /ext/soap/tests/bugs bug37083.phpt bug37083.wsdl
dmitry Tue Apr 18 13:08:11 2006 UTC Modified files: /php-src/ext/soap php_sdl.c /php-src/ext/soap/tests/bugsbug37083.phpt bug37083.wsdl Log: Fixed bug #37083 (Frequent crashs in SOAP extension with new WSDL caching code in multithread WS). (Andrei, Dmitry) http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_sdl.c?r1=1.98r2=1.99diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.98 php-src/ext/soap/php_sdl.c:1.99 --- php-src/ext/soap/php_sdl.c:1.98 Mon Apr 17 16:09:42 2006 +++ php-src/ext/soap/php_sdl.c Tue Apr 18 13:08:11 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.98 2006/04/17 16:09:42 andrei Exp $ */ +/* $Id: php_sdl.c,v 1.99 2006/04/18 13:08:11 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -143,13 +143,18 @@ enc = get_encoder_ex(NULL, enc_nscat, enc_len); efree(enc_nscat); if (enc sdl) { - encodePtr new_enc = emalloc(sizeof(encode)); + encodePtr new_enc = pemalloc(sizeof(encode), sdl-is_persistent); memcpy(new_enc, enc, sizeof(encode)); - new_enc-details.ns = estrndup(ns, ns_len); - new_enc-details.type_str = estrdup(new_enc-details.type_str); + if (sdl-is_persistent) { + new_enc-details.ns = zend_strndup(ns, ns_len); + new_enc-details.type_str = strdup(new_enc-details.type_str); + } else { + new_enc-details.ns = estrndup(ns, ns_len); + new_enc-details.type_str = estrdup(new_enc-details.type_str); + } if (sdl-encoders == NULL) { - sdl-encoders = emalloc(sizeof(HashTable)); - zend_hash_init(sdl-encoders, 0, NULL, delete_encoder, 0); + sdl-encoders = pemalloc(sizeof(HashTable), sdl-is_persistent); + zend_hash_init(sdl-encoders, 0, NULL, delete_encoder, sdl-is_persistent); } zend_hash_update(sdl-encoders, nscat, len + 1, new_enc, sizeof(encodePtr), NULL); enc = new_enc; http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/bugs/bug37083.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug37083.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug37083.phpt:1.2 --- /dev/null Tue Apr 18 13:08:11 2006 +++ php-src/ext/soap/tests/bugs/bug37083.phpt Tue Apr 18 13:08:11 2006 @@ -0,0 +1,58 @@ +--TEST-- +Bug #37083 (Frequent crashs in SOAP extension with new WSDL caching code in multithread WS) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +?php +class TestSoapClient extends SoapClient { + function __doRequest($request, $location, $action, $version) { + return EOF +?xml version=1.0 encoding=utf-8? +soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; +soapenv:Body +ns1:searchResponse soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:ns1=urn:java:de.pangaea.metadataportal.search.SearchService +searchReturn href=#id0/ +/ns1:searchResponse +multiRef id=id0 soapenc:root=0 soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xsi:type=ns2:SearchResponse xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:ns2=urn:java:de.pangaea.metadataportal.search.SearchServiceoffset xsi:type=xsd:int0/offsetqueryTime xsi:type=xsd:long34/queryTimeresults soapenc:arrayType=ns2:SearchResponseItem[10] xsi:type=soapenc:Arrayresults href=#id1/results href=#id2/results href=#id3/results href=#id4/results href=#id5/results href=#id6/results href=#id7/results href=#id8/results href=#id9/results href=#id10//resultstotalCount xsi:type=xsd:int3501/totalCount/multiRef +multiRef id=id9 soapenc:root=0 soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xsi:type=ns3:SearchResponseItem xmlns:ns3=urn:java:de.pangaea.metadataportal.search.SearchService xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/;fields href=#id11/identifier xsi:type=xsd:stringoai:dlmd.ifremer.fr:5900168/identifierscore xsi:type=xsd:float0.13684115/scorexml xsi:type=xsd:stringxml1/xml/multiRef +multiRef id=id7 soapenc:root=0 soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xsi:type=ns4:SearchResponseItem xmlns:ns4=urn:java:de.pangaea.metadataportal.search.SearchService
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Apr 17 13:16:15 2006 UTC Modified files: /php-src/ext/soap php_sdl.c Log: Fixed several bugs in new caching WSDL in memory code Re-enabled disk cache http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_sdl.c?r1=1.96r2=1.97diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.96 php-src/ext/soap/php_sdl.c:1.97 --- php-src/ext/soap/php_sdl.c:1.96 Mon Apr 10 10:11:29 2006 +++ php-src/ext/soap/php_sdl.c Mon Apr 17 13:16:15 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.96 2006/04/10 10:11:29 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.97 2006/04/17 13:16:15 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -2269,7 +2269,7 @@ sdlRestrictionIntPtr *rest = (sdlRestrictionIntPtr *)data; sdlRestrictionIntPtr prest = NULL; - prest = malloc(sizeof(sdlRestrictionIntPtr)); + prest = malloc(sizeof(sdlRestrictionInt)); *prest = **rest; *rest = prest; } @@ -2843,8 +2843,12 @@ psdl = malloc(sizeof(*sdl)); memset(psdl, 0, sizeof(*sdl)); - psdl-source = strdup(sdl-source); - psdl-target_ns = strdup(sdl-target_ns); + if (sdl-source) { + psdl-source = strdup(sdl-source); + } + if (sdl-target_ns) { + psdl-target_ns = strdup(sdl-target_ns); + } if (sdl-groups) { sdlTypePtr *tmp; @@ -3026,6 +3030,20 @@ php_stream_context *context=NULL; zval **tmp, **proxy_host, **proxy_port, *orig_context = NULL, *new_context = NULL; smart_str headers = {0}; + char *pkey = NULL; + int plen; + + if (persistent) { + zend_rsrc_list_entry *le_ptr; + + plen = spprintf(pkey, 0, SOAP:WSDL:%s, uri); + if (SUCCESS == zend_hash_find(EG(persistent_list), pkey, plen+1, (void*)le_ptr)) { + if (Z_TYPE_P(le_ptr) == php_soap_psdl_list_entry()) { + efree(pkey); + return (sdlPtr)le_ptr-ptr; + } + } + } if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr), _stream_context, sizeof(_stream_context), (void**)tmp)) { @@ -3090,7 +3108,6 @@ SOAP_GLOBAL(error_code) = WSDL; -#if 0 if (SOAP_GLOBAL(cache_enabled) ((uri_len = strlen(uri)) MAXPATHLEN)) { char fn[MAXPATHLEN]; @@ -3128,26 +3145,21 @@ } else { sdl = load_wsdl(this_ptr, uri TSRMLS_CC); } -#endif + + if (sdl) { + sdl-is_persistent = 0; + } if (persistent) { - char *hashkey = NULL; - int plen; - zend_rsrc_list_entry le, *le_ptr; + if (sdl) { + zend_rsrc_list_entry le; + sdlPtr psdl = make_persistent_sdl(sdl TSRMLS_CC); - plen = spprintf(hashkey, 0, SOAP:WSDL:%s, uri); - if (SUCCESS == zend_hash_find(EG(persistent_list), hashkey, plen+1, (void*)le_ptr)) { - if (Z_TYPE_P(le_ptr) == php_soap_psdl_list_entry()) { - sdl = (sdlPtr)le_ptr-ptr; - } - } else { - sdlPtr psdl = NULL; - sdl = load_wsdl(this_ptr, uri TSRMLS_CC); - psdl = make_persistent_sdl(sdl TSRMLS_CC); psdl-is_persistent = 1; le.type = php_soap_psdl_list_entry(); le.ptr = psdl; - if (SUCCESS == zend_hash_update(EG(persistent_list), hashkey, + le.refcount = 0; + if (SUCCESS == zend_hash_update(EG(persistent_list), pkey, plen+1, (void*)le, sizeof(le), NULL)) { /* remove non-persitent sdl structure */ delete_sdl_impl(sdl); @@ -3156,14 +3168,11 @@ } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to register persistent entry); /* clean up persistent sdl */ - delete_psdl(le_ptr TSRMLS_CC); + delete_psdl(le TSRMLS_CC); /* keep non-persistent sdl and return it */ } } - efree(hashkey); - } else { - sdl = load_wsdl(this_ptr, uri TSRMLS_CC); - sdl-is_persistent = 0; + efree(pkey); } SOAP_GLOBAL(error_code) = old_error_code; -- PHP
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Apr 10 10:11:29 2006 UTC Modified files: /php-src/ext/soap php_sdl.c Log: ZTS fix http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_sdl.c?r1=1.95r2=1.96diff_format=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.95 php-src/ext/soap/php_sdl.c:1.96 --- php-src/ext/soap/php_sdl.c:1.95 Sun Apr 9 23:38:30 2006 +++ php-src/ext/soap/php_sdl.c Mon Apr 10 10:11:29 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.95 2006/04/09 23:38:30 andrei Exp $ */ +/* $Id: php_sdl.c,v 1.96 2006/04/10 10:11:29 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -3156,7 +3156,7 @@ } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to register persistent entry); /* clean up persistent sdl */ - delete_psdl(le_ptr); + delete_psdl(le_ptr TSRMLS_CC); /* keep non-persistent sdl and return it */ } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c soap.c /ext/spl spl_iterators.c /ext/standard math.c /ext/xmlreader php_xmlreader.c /ext/xmlwriter php_xmlwriter.c
tony2001Mon Feb 6 11:28:20 2006 UTC Modified files: /php-src/ext/xmlwriter php_xmlwriter.c /php-src/ext/xmlreader php_xmlreader.c /php-src/ext/standard math.c /php-src/ext/splspl_iterators.c /php-src/ext/soap soap.c php_sdl.c Log: initialize variables and reduce the number of warnings http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.29r2=1.30diff_format=u Index: php-src/ext/xmlwriter/php_xmlwriter.c diff -u php-src/ext/xmlwriter/php_xmlwriter.c:1.29 php-src/ext/xmlwriter/php_xmlwriter.c:1.30 --- php-src/ext/xmlwriter/php_xmlwriter.c:1.29 Sun Jan 1 13:09:56 2006 +++ php-src/ext/xmlwriter/php_xmlwriter.c Mon Feb 6 11:28:20 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_xmlwriter.c,v 1.29 2006/01/01 13:09:56 sniper Exp $ */ +/* $Id: php_xmlwriter.c,v 1.30 2006/02/06 11:28:20 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1341,7 +1341,7 @@ #ifdef ZEND_ENGINE_2 zval *this = getThis(); - ze_xmlwriter_object *ze_obj; + ze_xmlwriter_object *ze_obj = NULL; #endif #ifndef ZEND_ENGINE_2 @@ -1420,7 +1420,7 @@ #ifdef ZEND_ENGINE_2 zval *this = getThis(); - ze_xmlwriter_object *ze_obj; + ze_xmlwriter_object *ze_obj = NULL; #endif #ifdef ZEND_ENGINE_2 http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.26r2=1.27diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.26 php-src/ext/xmlreader/php_xmlreader.c:1.27 --- php-src/ext/xmlreader/php_xmlreader.c:1.26 Sun Jan 1 13:09:56 2006 +++ php-src/ext/xmlreader/php_xmlreader.c Mon Feb 6 11:28:20 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.26 2006/01/01 13:09:56 sniper Exp $ */ +/* $Id: php_xmlreader.c,v 1.27 2006/02/06 11:28:20 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -832,7 +832,7 @@ zval *id; int source_len = 0, encoding_len = 0; long options = 0; - xmlreader_object *intern; + xmlreader_object *intern = NULL; char *source, *valid_file = NULL; char *encoding = NULL; char resolved_path[MAXPATHLEN + 1]; @@ -977,7 +977,7 @@ zval *id; int source_len = 0, encoding_len = 0; long options = 0; - xmlreader_object *intern; + xmlreader_object *intern = NULL; char *source, *uri = NULL, *encoding = NULL; int resolved_path_len; char *directory=NULL, resolved_path[MAXPATHLEN]; http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/math.c?r1=1.133r2=1.134diff_format=u Index: php-src/ext/standard/math.c diff -u php-src/ext/standard/math.c:1.133 php-src/ext/standard/math.c:1.134 --- php-src/ext/standard/math.c:1.133 Tue Jan 17 12:18:52 2006 +++ php-src/ext/standard/math.c Mon Feb 6 11:28:20 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: math.c,v 1.133 2006/01/17 12:18:52 dmitry Exp $ */ +/* $Id: math.c,v 1.134 2006/02/06 11:28:20 tony2001 Exp $ */ #include php.h #include php_math.h @@ -448,7 +448,7 @@ /* calculate pow(long,long) in O(log exp) operations, bail if overflow */ while (i = 1) { int overflow; - double dval; + double dval = 0.0; if (i % 2) { --i; http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.112r2=1.113diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.112 php-src/ext/spl/spl_iterators.c:1.113 --- php-src/ext/spl/spl_iterators.c:1.112 Sun Feb 5 23:31:47 2006 +++ php-src/ext/spl/spl_iterators.c Mon Feb 6 11:28:20 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.112 2006/02/05 23:31:47 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.113 2006/02/06 11:28:20 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -838,7 +838,7 @@ { zval *zobject, *retval; spl_dual_it_object *intern; - zend_class_entry *ce; + zend_class_entry *ce = NULL; int inc_refcount = 1; http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/soap.c?r1=1.171r2=1.172diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.171 php-src/ext/soap/soap.c:1.172 --- php-src/ext/soap/soap.c:1.171 Mon Feb 6 11:00:51 2006 +++ php-src/ext/soap/soap.c Mon Feb 6 11:28:20 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/*
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Nov 28 05:09:10 2005 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #35399 (Since fix of bug #35273 SOAP decoding of soapenc:base64binary fails) http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.90r2=1.91ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.90 php-src/ext/soap/php_sdl.c:1.91 --- php-src/ext/soap/php_sdl.c:1.90 Fri Nov 18 05:59:51 2005 +++ php-src/ext/soap/php_sdl.c Mon Nov 28 05:09:07 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.90 2005/11/18 10:59:51 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.91 2005/11/28 10:09:07 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -1289,6 +1289,40 @@ enc-details.sdl_type = types[i]; enc-to_xml = sdl_guess_convert_xml; enc-to_zval = sdl_guess_convert_zval; + + if (enc-details.sdl_type == NULL) { + int ns_len = strlen(enc-details.ns); + int type_len = strlen(enc-details.type_str); + + if (((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 + memcmp(enc-details.ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) || +(ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 + memcmp(enc-details.ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) { + char *enc_nscat; + int enc_ns_len; + int enc_len; + encodePtr real_enc; + + enc_ns_len = sizeof(XSD_NAMESPACE)-1; + enc_len = enc_ns_len + type_len + 1; + enc_nscat = emalloc(enc_len + 1); + memcpy(enc_nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1); + enc_nscat[enc_ns_len] = ':'; + memcpy(enc_nscat+enc_ns_len+1, enc-details.type_str, type_len); + enc_nscat[enc_len] = '\0'; + + real_enc = get_encoder_ex(NULL, enc_nscat, enc_len); + efree(enc_nscat); + if (real_enc) { + enc-to_zval = real_enc-to_zval; + enc-to_xml = real_enc-to_xml; + enc-to_zval_before = real_enc-to_zval_before; + enc-to_xml_before = real_enc-to_xml_before; + enc-to_zval_after = real_enc-to_zval_after; + enc-to_xml_after = real_enc-to_xml_after; + } + } + } } static void sdl_deserialize_soap_body(sdlSoapBindingFunctionBodyPtr body, encodePtr *encoders, sdlTypePtr *types, char **in) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /ext/soap/tests/bugs bug35273.phpt
dmitry Fri Nov 18 05:59:55 2005 EDT Added files: /php-src/ext/soap/tests/bugsbug35273.phpt Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #35273 (Error in mapping soap - java types) http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.89r2=1.90ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.89 php-src/ext/soap/php_sdl.c:1.90 --- php-src/ext/soap/php_sdl.c:1.89 Mon Oct 24 03:43:48 2005 +++ php-src/ext/soap/php_sdl.c Fri Nov 18 05:59:51 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.89 2005/10/24 07:43:48 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.90 2005/11/18 10:59:51 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -117,24 +117,40 @@ nscat[len] = '\0'; enc = get_encoder_ex(sdl, nscat, len); - efree(nscat); if (enc == NULL ((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 memcmp(ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) || (ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 memcmp(ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) { - ns_len = sizeof(XSD_NAMESPACE)-1; - len = ns_len + type_len + 1; - nscat = emalloc(len + 1); - memcpy(nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1); - nscat[ns_len] = ':'; - memcpy(nscat+ns_len+1, type, type_len); - nscat[len] = '\0'; - - enc = get_encoder_ex(sdl, nscat, len); - efree(nscat); + char *enc_nscat; + int enc_ns_len; + int enc_len; + + enc_ns_len = sizeof(XSD_NAMESPACE)-1; + enc_len = enc_ns_len + type_len + 1; + enc_nscat = emalloc(enc_len + 1); + memcpy(enc_nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1); + enc_nscat[enc_ns_len] = ':'; + memcpy(enc_nscat+enc_ns_len+1, type, type_len); + enc_nscat[enc_len] = '\0'; + + enc = get_encoder_ex(NULL, enc_nscat, enc_len); + efree(enc_nscat); + if (enc sdl) { + encodePtr new_enc = emalloc(sizeof(encode)); + memcpy(new_enc, enc, sizeof(encode)); + new_enc-details.ns = estrndup(ns, ns_len); + new_enc-details.type_str = estrdup(new_enc-details.type_str); + if (sdl-encoders == NULL) { + sdl-encoders = emalloc(sizeof(HashTable)); + zend_hash_init(sdl-encoders, 0, NULL, delete_encoder, 0); + } + zend_hash_update(sdl-encoders, nscat, len + 1, new_enc, sizeof(encodePtr), NULL); + enc = new_enc; + } } + efree(nscat); return enc; } http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug35273.phpt?r=1.1p=1 Index: php-src/ext/soap/tests/bugs/bug35273.phpt +++ php-src/ext/soap/tests/bugs/bug35273.phpt --TEST-- Bug #35273 Error in mapping soap - java types --SKIPIF-- ?php require_once('skipif.inc'); ? --FILE-- ?php class TestSoapClient extends SoapClient { function __doRequest($request, $location, $action, $version) { echo $request; exit; } } ini_set(soap.wsdl_cache_enabled, 0); $client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array(trace = 1, 'exceptions' = 0)); $ahoj = $client-echoPerson(array(name=Name,surname=Surname)); echo ok\n; ? --EXPECT-- ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=http://service; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:ns2=urn:service.EchoService xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;SOAP-ENV:Bodyns1:echoPersonp xsi:type=ns2:Personname xsi:type=SOAP-ENC:stringName/namesurname xsi:type=SOAP-ENC:stringSurname/surname/p/ns1:echoPerson/SOAP-ENV:Body/SOAP-ENV:Envelope -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Oct 24 03:43:51 2005 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #34950 (Unable to get WSDL through proxy) http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.88r2=1.89ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.88 php-src/ext/soap/php_sdl.c:1.89 --- php-src/ext/soap/php_sdl.c:1.88 Wed Aug 3 10:07:48 2005 +++ php-src/ext/soap/php_sdl.c Mon Oct 24 03:43:48 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.88 2005/08/03 14:07:48 sniper Exp $ */ +/* $Id: php_sdl.c,v 1.89 2005/10/24 07:43:48 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -2235,6 +2235,7 @@ smart_str_appends(proxy,Z_STRVAL_PP(proxy_host)); smart_str_appends(proxy,:); smart_str_appends(proxy,Z_STRVAL(str_port)); + smart_str_0(proxy); zval_dtor(str_port); MAKE_STD_ZVAL(str_proxy); ZVAL_STRING(str_proxy, proxy.c, 1); @@ -2246,6 +2247,11 @@ php_stream_context_set_option(context, http, proxy, str_proxy); zval_ptr_dtor(str_proxy); + MAKE_STD_ZVAL(str_proxy); + ZVAL_BOOL(str_proxy, 1); + php_stream_context_set_option(context, http, request_fulluri, str_proxy); + zval_ptr_dtor(str_proxy); + proxy_authentication(this_ptr, headers TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Mar 28 10:21:51 2005 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed wrong SOAP headers encoding/decoding. http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.80r2=1.81ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.80 php-src/ext/soap/php_sdl.c:1.81 --- php-src/ext/soap/php_sdl.c:1.80 Mon Mar 21 10:52:50 2005 +++ php-src/ext/soap/php_sdl.c Mon Mar 28 10:21:50 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.80 2005/03/21 15:52:50 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.81 2005/03/28 15:21:50 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -423,6 +423,10 @@ h-ns = estrdup(h-element-namens); } } + if (h-element-name) { + efree(h-name); + h-name = estrdup(h-element-name); + } } } if (!fault) { @@ -1061,7 +1065,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0b +#define WSDL_CACHE_VERSION 0x0c #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf)ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]8)|((unsigned char)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c php_sdl.h /ext/soap/tests/bugs bug30928.wsdl /ext/soap/tests/schema test_schema.inc
dmitry Mon Mar 21 10:52:54 2005 EDT Modified files: /php-src/ext/soap php_sdl.c php_sdl.h /php-src/ext/soap/tests/bugsbug30928.wsdl /php-src/ext/soap/tests/schema test_schema.inc Log: Support for soap:body parts attribute http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.79r2=1.80ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.79 php-src/ext/soap/php_sdl.c:1.80 --- php-src/ext/soap/php_sdl.c:1.79 Thu Mar 17 03:15:23 2005 +++ php-src/ext/soap/php_sdl.c Mon Mar 21 10:52:50 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.79 2005/03/17 08:15:23 sniper Exp $ */ +/* $Id: php_sdl.c,v 1.80 2005/03/21 15:52:50 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -480,8 +480,43 @@ tmp = get_attribute(body-properties, parts); if (tmp) { - whiteSpace_collapse(tmp-children-content); - binding-parts = estrdup(tmp-children-content); + HashTableht; + char *parts = tmp-children-content; + + /* Delete all parts those are not in the parts attribute */ + zend_hash_init(ht, 0, NULL, delete_parameter, 0); + while (*parts) { + HashPosition pos; + sdlParamPtr *param; + int found = 0; + char *end; + + while (*parts == ' ') ++parts; + if (*parts == '\0') break; + end = strchr(parts, ' '); + if (end) *end = '\0'; + zend_hash_internal_pointer_reset_ex(params, pos); + while (zend_hash_get_current_data_ex(params, (void **)param, pos) != FAILURE) { + if ((*param)-paramName + strcmp(parts, (*param)-paramName) == 0) { + sdlParamPtr x_param; + x_param = emalloc(sizeof(sdlParam)); + *x_param = **param; + (*param)-paramName = NULL; + zend_hash_next_index_insert(ht, x_param, sizeof(sdlParamPtr), NULL); + found = 1; + break; + } + zend_hash_move_forward_ex(params, pos); + } + if (!found) { + soap_error1(E_ERROR, Parsing WSDL: Missing part '%s' in message, parts); + } + parts += strlen(parts); + if (end) *end = ' '; + } + zend_hash_destroy(params); + *params = ht; } if (binding-use == SOAP_ENCODED) { @@ -1026,7 +1061,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0a +#define WSDL_CACHE_VERSION 0x0b #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf)ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]8)|((unsigned char)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; @@ -1274,7 +1309,6 @@ body-encodingStyle = SOAP_ENCODING_DEFAULT; } body-ns = sdl_deserialize_string(in); - body-parts = sdl_deserialize_string(in); WSDL_CACHE_GET_INT(i, in); if (i 0) { body-headers = emalloc(sizeof(HashTable)); @@ -1875,7 +1909,6 @@ WSDL_CACHE_PUT_1(body-encodingStyle, out); } sdl_serialize_string(body-ns, out); - sdl_serialize_string(body-parts, out); if (body-headers) { i = zend_hash_num_elements(body-headers); } else { @@ -2310,9 +2343,6 @@ if (body.ns) { efree(body.ns); } - if (body.parts) { - efree(body.parts); - } if (body.headers) { zend_hash_destroy(body.headers); efree(body.headers);
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c /main php.h TSRM TSRM.h tsrm_config_common.h
rasmus Wed Mar 16 17:00:07 2005 EDT Modified files: /php-src/main php.h /TSRM TSRM.h tsrm_config_common.h /php-src/ext/soap php_sdl.c Log: Fix Jani breakage http://cvs.php.net/diff.php/php-src/main/php.h?r1=1.214r2=1.215ty=u Index: php-src/main/php.h diff -u php-src/main/php.h:1.214 php-src/main/php.h:1.215 --- php-src/main/php.h:1.214Tue Mar 8 16:42:10 2005 +++ php-src/main/php.h Wed Mar 16 17:00:03 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php.h,v 1.214 2005/03/08 21:42:10 sniper Exp $ */ +/* $Id: php.h,v 1.215 2005/03/16 22:00:03 rasmus Exp $ */ #ifndef PHP_H #define PHP_H @@ -397,7 +397,7 @@ /* Virtual current working directory support */ -#include tsrm_virtual_cwd.h +#include ../TSRM/tsrm_virtual_cwd.h #include zend_constants.h http://cvs.php.net/diff.php/TSRM/TSRM.h?r1=1.46r2=1.47ty=u Index: TSRM/TSRM.h diff -u TSRM/TSRM.h:1.46 TSRM/TSRM.h:1.47 --- TSRM/TSRM.h:1.46Mon Feb 21 05:01:34 2005 +++ TSRM/TSRM.h Wed Mar 16 17:00:06 2005 @@ -15,7 +15,7 @@ /* #ifndef WIN32 */ #ifndef WIN32 -# include tsrm_config.h +# include tsrm_config.h #endif #ifdef WIN32 http://cvs.php.net/diff.php/TSRM/tsrm_config_common.h?r1=1.15r2=1.16ty=u Index: TSRM/tsrm_config_common.h diff -u TSRM/tsrm_config_common.h:1.15 TSRM/tsrm_config_common.h:1.16 --- TSRM/tsrm_config_common.h:1.15 Mon Feb 21 05:07:28 2005 +++ TSRM/tsrm_config_common.h Wed Mar 16 17:00:06 2005 @@ -8,7 +8,7 @@ #ifdef TSRM_WIN32 # include tsrm_config.w32.h #else -# include tsrm_config.h +# include tsrm_config.h # include sys/param.h #endif http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.77r2=1.78ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.77 php-src/ext/soap/php_sdl.c:1.78 --- php-src/ext/soap/php_sdl.c:1.77 Mon Jan 31 10:08:24 2005 +++ php-src/ext/soap/php_sdl.c Wed Mar 16 17:00:07 2005 @@ -17,14 +17,14 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.77 2005/01/31 15:08:24 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.78 2005/03/16 22:00:07 rasmus Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h #include libxml/uri.h #include ext/standard/md5.h -#include tsrm_virtual_cwd.h +#include ../../TSRM/tsrm_virtual_cwd.h #include sys/types.h #include sys/stat.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Jan 31 10:08:25 2005 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed SIGSEGV when restoring WSDL without functions from cache http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.76r2=1.77ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.76 php-src/ext/soap/php_sdl.c:1.77 --- php-src/ext/soap/php_sdl.c:1.76 Tue Nov 9 03:13:35 2004 +++ php-src/ext/soap/php_sdl.c Mon Jan 31 10:08:24 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.76 2004/11/09 08:13:35 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.77 2005/01/31 15:08:24 dmitry Exp $ */ #include php_soap.h #include ext/libxml/php_libxml.h @@ -1506,8 +1506,8 @@ /* deserialize functions */ WSDL_CACHE_GET_INT(num_func, in); + zend_hash_init(sdl-functions, num_func, NULL, delete_function, 0); if (num_func 0) { - zend_hash_init(sdl-functions, num_func, NULL, delete_function, 0); functions = emalloc(num_func*sizeof(sdlFunctionPtr)); for (i = 0; i num_func; i++) { int binding_num, num_faults; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Wed Sep 22 01:58:41 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #30182 (SOAP module processing WSDL file dumps core). http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.73r2=1.74ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.73 php-src/ext/soap/php_sdl.c:1.74 --- php-src/ext/soap/php_sdl.c:1.73 Thu Aug 26 14:43:06 2004 +++ php-src/ext/soap/php_sdl.c Wed Sep 22 01:58:40 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.73 2004/08/26 18:43:06 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.74 2004/09/22 05:58:40 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -2168,13 +2168,14 @@ { sdlPtr sdl = NULL; char* old_error_code = SOAP_GLOBAL(error_code); + int uri_len; SOAP_GLOBAL(error_code) = WSDL; - if (SOAP_GLOBAL(cache_enabled)) { + if (SOAP_GLOBAL(cache_enabled) ((uri_len = strlen(uri)) MAXPATHLEN)) { char fn[MAXPATHLEN]; - if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri,strlen(uri))) { + if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) { strcpy(fn, uri); } else if (VCWD_REALPATH(uri, fn) == NULL) { sdl = load_wsdl(uri); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Thu Aug 26 14:43:07 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Fixed bug #29839 (incorrect convert (xml:lang to lang)) http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.72r2=1.73ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.72 php-src/ext/soap/php_sdl.c:1.73 --- php-src/ext/soap/php_sdl.c:1.72 Thu Aug 26 14:40:10 2004 +++ php-src/ext/soap/php_sdl.c Thu Aug 26 14:43:06 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.72 2004/08/26 18:40:10 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.73 2004/08/26 18:43:06 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -1473,35 +1473,6 @@ /* deserialize functions */ WSDL_CACHE_GET_INT(num_func, in); - php_sdl.c - zend_hash_init(sdl-functions, num_func, NULL, delete_function, 0); - functions = emalloc(num_func*sizeof(sdlFunctionPtr)); - for (i = 0; i num_func; i++) { - int binding_num, num_faults; - sdlFunctionPtr func = emalloc(sizeof(sdlFunction)); - sdl_deserialize_key(sdl-functions, func, in); - func-functionName = sdl_deserialize_string(in); - func-requestName = sdl_deserialize_string(in); - func-responseName = sdl_deserialize_string(in); - - WSDL_CACHE_GET_INT(binding_num, in); - if (binding_num == 0) { - func-binding = NULL; - } else { - func-binding = bindings[binding_num-1]; - } - if (func-binding func-binding-bindingType == BINDING_SOAP *in != 0) { - sdlSoapBindingFunctionPtr binding = func-bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction)); - memset(binding, 0, sizeof(sdlSoapBindingFunction)); - WSDL_CACHE_GET_1(binding-style,sdlEncodingStyle,in); - binding-soapAction = sdl_deserialize_string(in); - sdl_deserialize_soap_body(binding-input, encoders, types, in); - sdl_deserialize_soap_body(binding-output, encoders, types, in); - } else { - WSDL_CACHE_SKIP(1, in); - func-bindingAttributes = NULL; - } -=== if (num_func 0) { zend_hash_init(sdl-functions, num_func, NULL, delete_function, 0); functions = emalloc(num_func*sizeof(sdlFunctionPtr)); @@ -1530,7 +1501,6 @@ WSDL_CACHE_SKIP(1, in); func-bindingAttributes = NULL; } - 1.70.2.3 func-requestParameters = sdl_deserialize_parameters(encoders, types, in); func-responseParameters = sdl_deserialize_parameters(encoders, types, in); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
iliaa Mon Jul 5 17:31:35 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Eliminate alloca() calls where they can be affected by the users. http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.69r2=1.70ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.69 php-src/ext/soap/php_sdl.c:1.70 --- php-src/ext/soap/php_sdl.c:1.69 Wed May 5 06:31:26 2004 +++ php-src/ext/soap/php_sdl.c Mon Jul 5 17:31:35 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.69 2004/05/05 10:31:26 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.70 2004/07/05 21:31:35 iliaa Exp $ */ #include php_soap.h #include libxml/uri.h @@ -52,7 +52,7 @@ int ns_len = strlen(nsptr-href); int type_len = strlen(cptype); int len = ns_len + type_len + 1; - char *nscat = do_alloca(len + 1); + char *nscat = emalloc(len + 1); memcpy(nscat, nsptr-href, ns_len); nscat[ns_len] = ':'; @@ -63,7 +63,7 @@ if (enc == NULL) { enc = get_encoder_ex(sdl, type, type_len); } - free_alloca(nscat); + efree(nscat); } else { enc = get_encoder_ex(sdl, type, strlen(type)); } @@ -88,7 +88,7 @@ int ns_len = strlen(nsptr-href); int type_len = strlen(cptype); int len = ns_len + type_len + 1; - char *nscat = do_alloca(len + 1); + char *nscat = emalloc(len + 1); memcpy(nscat, nsptr-href, ns_len); nscat[ns_len] = ':'; @@ -100,7 +100,7 @@ } else if (zend_hash_find(sdl-elements, (char*)type, type_len + 1, (void **)sdl_type) == SUCCESS) { ret = *sdl_type; } - free_alloca(nscat); + efree(nscat); } else { if (zend_hash_find(sdl-elements, (char*)type, strlen(type) + 1, (void **)sdl_type) == SUCCESS) { ret = *sdl_type; @@ -121,7 +121,7 @@ int type_len = strlen(type); int len = ns_len + type_len + 1; - nscat = do_alloca(len + 1); + nscat = emalloc(len + 1); memcpy(nscat, ns, ns_len); nscat[ns_len] = ':'; memcpy(nscat+ns_len+1, type, type_len); @@ -129,7 +129,7 @@ enc = get_encoder_ex(sdl, nscat, len); - free_alloca(nscat); + efree(nscat); return enc; } @@ -2190,7 +2190,7 @@ PHP_MD5Update(context, fn, strlen(fn)); PHP_MD5Final(digest, context); make_digest(md5str, digest); - key = do_alloca(len+sizeof(/wsdl-)-1+sizeof(md5str)); + key = emalloc(len+sizeof(/wsdl-)-1+sizeof(md5str)); memcpy(key,SOAP_GLOBAL(cache_dir),len); memcpy(key+len,/wsdl-,sizeof(/wsdl-)-1); memcpy(key+len+sizeof(/wsdl-)-1,md5str,sizeof(md5str)); @@ -2201,7 +2201,7 @@ add_sdl_to_cache(key, fn, t, sdl); } } - free_alloca(key); + efree(key); } } else { sdl = load_wsdl(uri); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Thu Feb 19 11:46:53 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: WSDL caching bugs were fixed http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.63r2=1.64ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.63 php-src/ext/soap/php_sdl.c:1.64 --- php-src/ext/soap/php_sdl.c:1.63 Thu Feb 19 03:21:12 2004 +++ php-src/ext/soap/php_sdl.c Thu Feb 19 11:46:52 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.63 2004/02/19 08:21:12 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.64 2004/02/19 16:46:52 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -954,10 +954,10 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 06 +#define WSDL_CACHE_VERSION 07 #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); -#define WSDL_CACHE_GET_INT(ret,buf)ret = ((int)(*buf)[0])|((int)(*buf)[1]8)|((int)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; +#define WSDL_CACHE_GET_INT(ret,buf)ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]8)|((unsigned char)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; #define WSDL_CACHE_GET_1(ret,type,buf) ret = (type)(**buf); (*buf)++; #define WSDL_CACHE_GET_N(ret,n,buf)memcpy(ret,*buf,n); *buf += n; #define WSDL_CACHE_SKIP(n,buf) *buf += n; @@ -975,7 +975,7 @@ int len; WSDL_CACHE_GET_INT(len, in); - if (len == 0) { + if (len == 0x7fff) { return NULL; } else { s = emalloc(len+1); @@ -1487,7 +1487,7 @@ int function_num; WSDL_CACHE_GET_INT(function_num, in); - sdl_deserialize_key(sdl-requests, functions[function_num], in); + sdl_deserialize_key(sdl-requests, functions[function_num-1], in); i--; } } @@ -1506,12 +1506,12 @@ if (str) { i = strlen(str); + WSDL_CACHE_PUT_INT(i, out); + if (i 0) { + WSDL_CACHE_PUT_N(str, i, out); + } } else { - i = 0; - } - WSDL_CACHE_PUT_INT(i, out); - if (i 0) { - WSDL_CACHE_PUT_N(str, i, out); + WSDL_CACHE_PUT_INT(0x7fff, out); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Thu Feb 19 13:49:51 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Don't try to use input name instead of opeartion name for encoding RPC call http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.64r2=1.65ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.64 php-src/ext/soap/php_sdl.c:1.65 --- php-src/ext/soap/php_sdl.c:1.64 Thu Feb 19 11:46:52 2004 +++ php-src/ext/soap/php_sdl.c Thu Feb 19 13:49:50 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.64 2004/02/19 16:46:52 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.65 2004/02/19 18:49:50 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -775,9 +775,12 @@ function-requestParameters = wsdl_message(ctx, message-children-content); name = get_attribute(input-properties, name); +/* FIXME if (name != NULL) { function-requestName = estrdup(name-children-content); } else { +*/ + { function-requestName = estrdup(function-functionName); } @@ -801,11 +804,14 @@ function-responseParameters = wsdl_message(ctx, message-children-content); name = get_attribute(output-properties, name); +/* FIXME if (name != NULL) { function-responseName = estrdup(name-children-content); } else if (input == NULL) { function-responseName = estrdup(function-functionName); } else { +*/ + { int len = strlen(function-functionName); function-responseName = emalloc(len + sizeof(Response)); memcpy(function-responseName, function-functionName, len); @@ -954,7 +960,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 07 +#define WSDL_CACHE_VERSION 0x08 #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf)ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]8)|((unsigned char)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Tue Feb 17 04:23:30 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: fix: Using proper namespace for soap:header if it is not specified. http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.60r2=1.61ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.60 php-src/ext/soap/php_sdl.c:1.61 --- php-src/ext/soap/php_sdl.c:1.60 Mon Feb 16 11:32:52 2004 +++ php-src/ext/soap/php_sdl.c Tue Feb 17 04:23:28 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.60 2004/02/16 16:32:52 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.61 2004/02/17 09:23:28 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -390,19 +390,6 @@ memset(h, 0, sizeof(sdlSoapBindingFunctionHeader)); h-name = estrdup(tmp-children-content); - tmp = get_attribute(part-properties, type); - if (tmp != NULL) { - h-encode = get_encoder_from_prefix(ctx-sdl, part, tmp-children-content); - } else { - tmp = get_attribute(part-properties, element); - if (tmp != NULL) { - h-element = get_element(ctx-sdl, part, tmp-children-content); - if (h-element) { - h-encode = h-element-encode; - } - } - } - tmp = get_attribute(header-properties, use); if (tmp !strncmp(tmp-children-content, encoded, sizeof(encoded))) { h-use = SOAP_ENCODED; @@ -428,6 +415,22 @@ } } + tmp = get_attribute(part-properties, type); + if (tmp != NULL) { + h-encode = get_encoder_from_prefix(ctx-sdl, part, tmp-children-content); + } else { + tmp = get_attribute(part-properties, element); + if (tmp != NULL) { + h-element = get_element(ctx-sdl, part, tmp-children-content); + if (h-element) { + h-encode = h-element-encode; + if (!h-ns h-element-namens) { + h-ns = estrdup(h-element-namens); + } + } + } + } + if (binding-headers == NULL) { binding-headers = emalloc(sizeof(HashTable)); zend_hash_init(binding-headers, 0, NULL, delete_header, 0); @@ -874,7 +877,7 @@ return ctx.sdl; } -#define WSDL_CACHE_VERSION 01 +#define WSDL_CACHE_VERSION 02 #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf)ret = ((int)(*buf)[0])|((int)(*buf)[1]8)|((int)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Mon Feb 16 11:32:53 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: BUGFIX: incorrect restoring of negative integers from WSDL cache http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.59r2=1.60ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.59 php-src/ext/soap/php_sdl.c:1.60 --- php-src/ext/soap/php_sdl.c:1.59 Fri Feb 13 10:19:09 2004 +++ php-src/ext/soap/php_sdl.c Mon Feb 16 11:32:52 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.59 2004/02/13 15:19:09 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.60 2004/02/16 16:32:52 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -877,7 +877,7 @@ #define WSDL_CACHE_VERSION 01 #define WSDL_CACHE_GET(ret,type,buf) memcpy(ret,*buf,sizeof(type)); *buf += sizeof(type); -#define WSDL_CACHE_GET_INT(ret,buf)ret = ((int)(*buf)[0])+((int)(*buf)[1]8)+((int)(*buf)[2]16)+((int)(*buf)[3]24); *buf += 4; +#define WSDL_CACHE_GET_INT(ret,buf)ret = ((int)(*buf)[0])|((int)(*buf)[1]8)|((int)(*buf)[2]16)|((int)(*buf)[3]24); *buf += 4; #define WSDL_CACHE_GET_1(ret,type,buf) ret = (type)(**buf); (*buf)++; #define WSDL_CACHE_GET_N(ret,n,buf)memcpy(ret,*buf,n); *buf += n; #define WSDL_CACHE_SKIP(n,buf) *buf += n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_sdl.c
dmitry Wed Feb 11 11:12:33 2004 EDT Modified files: /php-src/ext/soap php_sdl.c Log: Cache files access rights were changed. http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.55r2=1.56ty=u Index: php-src/ext/soap/php_sdl.c diff -u php-src/ext/soap/php_sdl.c:1.55 php-src/ext/soap/php_sdl.c:1.56 --- php-src/ext/soap/php_sdl.c:1.55 Wed Feb 11 08:53:48 2004 +++ php-src/ext/soap/php_sdl.c Wed Feb 11 11:12:31 2004 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_sdl.c,v 1.55 2004/02/11 13:53:48 dmitry Exp $ */ +/* $Id: php_sdl.c,v 1.56 2004/02/11 16:12:31 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -1580,7 +1580,11 @@ HashTable tmp_bindings; HashTable tmp_functions; +#ifdef ZEND_WIN32 f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE); +#else + f = open(fn,O_CREAT|O_WRONLY|O_EXCL|O_BINARY,S_IREAD|S_IWRITE|S_IROTH|S_IWOTH|S_IRGRP|S_IWGRP); +#endif if (f 0) {return;} zend_hash_init(tmp_types, 0, NULL, NULL, 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php