[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/soap php_packet_soap.c soap.c /ext/soap/tests/bugs bug29830.phpt bug29844.phpt bug29844.wsdl

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 08:20:13 2004 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/soap/tests/bugsbug29830.phpt bug29844.phpt 
bug29844.wsdl 

  Modified files:  
/php-srcNEWS 
/php-src/ext/soap   php_packet_soap.c soap.c 
  Log:
  Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
  Fixed bug #29830 (SoapServer::setClass() should not export non-public methods).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.58r2=1.1760.2.59ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.58 php-src/NEWS:1.1760.2.59
--- php-src/NEWS:1.1760.2.58Wed Aug 25 20:26:21 2004
+++ php-src/NEWSThu Aug 26 08:20:12 2004
@@ -9,6 +9,10 @@
   (Paul Hudson, Derick)
 - Fixed bug with raw_post_data not getting set (Brian)
 - Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev)
+- Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
+  (Dmitry)
+- Fixed bug #29830 (SoapServer::setClass() should not export non-public
+  methods). (Dmitry)
 - Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
   data). (Ilia)
 - Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia)
http://cvs.php.net/diff.php/php-src/ext/soap/php_packet_soap.c?r1=1.36r2=1.36.2.1ty=u
Index: php-src/ext/soap/php_packet_soap.c
diff -u php-src/ext/soap/php_packet_soap.c:1.36 
php-src/ext/soap/php_packet_soap.c:1.36.2.1
--- php-src/ext/soap/php_packet_soap.c:1.36 Fri May 21 10:50:19 2004
+++ php-src/ext/soap/php_packet_soap.c  Thu Aug 26 08:20:13 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_packet_soap.c,v 1.36 2004/05/21 14:50:19 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.36.2.1 2004/08/26 12:20:13 dmitry Exp $ */
 
 #include php_soap.h
 
@@ -250,8 +250,12 @@
while 
(zend_hash_get_current_data(fn-responseParameters, (void **)h_param) == SUCCESS) {
param = (*h_param);
if (fnb-style == SOAP_DOCUMENT) {
-   name = param-encode-details.type_str;
-   ns = param-encode-details.ns;
+   if (param-element) {
+   name = 
param-encode-details.type_str;
+   ns = param-encode-details.ns;
+   } else {
+   name = param-paramName;
+   }
} else {
name = fn-responseName;
/* ns = ? */
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.2r2=1.110.2.3ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.2 php-src/ext/soap/soap.c:1.110.2.3
--- php-src/ext/soap/soap.c:1.110.2.2   Tue Aug 10 12:30:30 2004
+++ php-src/ext/soap/soap.c Thu Aug 26 08:20:13 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: soap.c,v 1.110.2.2 2004/08/10 16:30:30 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.3 2004/08/26 12:20:13 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1126,7 +1126,9 @@
HashPosition pos;
zend_hash_internal_pointer_reset_ex(ft, pos);
while (zend_hash_get_current_data_ex(ft, (void **)f, pos) != 
FAILURE) {
-   add_next_index_string(return_value, f-common.function_name, 
1);
+   if ((service-type != SOAP_CLASS) || (f-common.fn_flags  
ZEND_ACC_PUBLIC)) {
+   add_next_index_string(return_value, 
f-common.function_name, 1);
+   }
zend_hash_move_forward_ex(ft, pos);
}
}

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29830.phpt?r=1.1p=1
Index: php-src/ext/soap/tests/bugs/bug29830.phpt
+++ php-src/ext/soap/tests/bugs/bug29830.phpt

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29844.phpt?r=1.1p=1
Index: php-src/ext/soap/tests/bugs/bug29844.phpt
+++ php-src/ext/soap/tests/bugs/bug29844.phpt

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29844.wsdl?r=1.1p=1
Index: php-src/ext/soap/tests/bugs/bug29844.wsdl
+++ php-src/ext/soap/tests/bugs/bug29844.wsdl

-- 
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_packet_soap.c soap.c /ext/soap/tests/bugs bug29830.phpt bug29844.phpt bug29844.wsdl

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 08:24:54 2004 EDT

  Modified files:  
/php-src/ext/soap   php_packet_soap.c soap.c 
/php-src/ext/soap/tests/bugsbug29830.phpt bug29844.phpt 
bug29844.wsdl 
  Log:
  Merged bug fixes from PHP_5_0.
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_packet_soap.c?r1=1.36r2=1.37ty=u
Index: php-src/ext/soap/php_packet_soap.c
diff -u php-src/ext/soap/php_packet_soap.c:1.36 php-src/ext/soap/php_packet_soap.c:1.37
--- php-src/ext/soap/php_packet_soap.c:1.36 Fri May 21 10:50:19 2004
+++ php-src/ext/soap/php_packet_soap.c  Thu Aug 26 08:24:54 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_packet_soap.c,v 1.36 2004/05/21 14:50:19 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.37 2004/08/26 12:24:54 dmitry Exp $ */
 
 #include php_soap.h
 
@@ -250,8 +250,12 @@
while 
(zend_hash_get_current_data(fn-responseParameters, (void **)h_param) == SUCCESS) {
param = (*h_param);
if (fnb-style == SOAP_DOCUMENT) {
-   name = param-encode-details.type_str;
-   ns = param-encode-details.ns;
+   if (param-element) {
+   name = 
param-encode-details.type_str;
+   ns = param-encode-details.ns;
+   } else {
+   name = param-paramName;
+   }
} else {
name = fn-responseName;
/* ns = ? */
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.115r2=1.116ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.115 php-src/ext/soap/soap.c:1.116
--- php-src/ext/soap/soap.c:1.115   Tue Aug 10 12:11:41 2004
+++ php-src/ext/soap/soap.c Thu Aug 26 08:24:54 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: soap.c,v 1.115 2004/08/10 16:11:41 dmitry Exp $ */
+/* $Id: soap.c,v 1.116 2004/08/26 12:24:54 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1126,7 +1126,9 @@
HashPosition pos;
zend_hash_internal_pointer_reset_ex(ft, pos);
while (zend_hash_get_current_data_ex(ft, (void **)f, pos) != 
FAILURE) {
-   add_next_index_string(return_value, f-common.function_name, 
1);
+   if ((service-type != SOAP_CLASS) || (f-common.fn_flags  
ZEND_ACC_PUBLIC)) {
+   add_next_index_string(return_value, 
f-common.function_name, 1);
+   }
zend_hash_move_forward_ex(ft, pos);
}
}
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29830.phpt?r1=1.1r2=1.2ty=u
Index: php-src/ext/soap/tests/bugs/bug29830.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29830.phpt:1.2
--- /dev/null   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/tests/bugs/bug29830.phpt   Thu Aug 26 08:24:54 2004
@@ -0,0 +1,25 @@
+--TEST--
+Bug #29844 (SoapServer::setClass() should not export non-public methods)
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+
+class hello_world {   
+  public function hello($to) {
+return 'Hello ' . $to;
+  }
+  private function bye($to) {
+return 'Bye ' . $to;
+  }
+}
+
+$server = new SoapServer(NULL, array(uri=test://));
+$server-setClass('hello_world');
+$functions = $server-getFunctions();
+foreach($functions as $func) {
+  echo $func . \n;
+}
+?
+--EXPECT--
+hello
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29844.phpt?r1=1.1r2=1.2ty=u
Index: php-src/ext/soap/tests/bugs/bug29844.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29844.phpt:1.2
--- /dev/null   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/tests/bugs/bug29844.phpt   Thu Aug 26 08:24:54 2004
@@ -0,0 +1,36 @@
+--TEST--
+Bug #29844 (SOAP doesn't return the result of a valid SOAP request)
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+
+class hello_world {   
+  public function hello($to) {
+return 'Hello ' . $to;
+  }
+}
+
+class LocalSoapClient extends SoapClient {
+
+  function LocalSoapClient($wsdl, $options) {
+$this-SoapClient($wsdl, $options);
+$this-server = new SoapServer($wsdl, $options);
+$this-server-setClass('hello_world');;
+  }
+
+  function __doRequest($request, $location, $action, 

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard formatted_print.c

2004-08-26 Thread Thies C. Arntzen
thies   Thu Aug 26 09:41:59 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   formatted_print.c 
  Log:
  @- Fixed bug #29838 Memory leak in sprintf argument swapping. (Thies)
  # by backporting one line from HEAD.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/formatted_print.c?r1=1.59.2.11r2=1.59.2.12ty=u
Index: php-src/ext/standard/formatted_print.c
diff -u php-src/ext/standard/formatted_print.c:1.59.2.11 
php-src/ext/standard/formatted_print.c:1.59.2.12
--- php-src/ext/standard/formatted_print.c:1.59.2.11Sun Jul 18 13:29:45 2004
+++ php-src/ext/standard/formatted_print.c  Thu Aug 26 09:41:59 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: formatted_print.c,v 1.59.2.11 2004/07/18 17:29:45 iliaa Exp $ */
+/* $Id: formatted_print.c,v 1.59.2.12 2004/08/26 13:41:59 thies Exp $ */
 
 #include math.h  /* modf() */
 #include php.h
@@ -630,6 +630,7 @@
if (multiuse) {
MAKE_STD_ZVAL(tmp);
*tmp = **(args[argnum]);
+   INIT_PZVAL(tmp);
zval_copy_ctor(tmp);
} else {
SEPARATE_ZVAL(args[argnum]);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/soap php_encoding.c /ext/soap/tests/bugs bug29795.phpt bug29795.wsdl

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 11:23:57 2004 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/soap/tests/bugsbug29795.phpt bug29795.wsdl 

  Modified files:  
/php-srcNEWS 
/php-src/ext/soap   php_encoding.c 
  Log:
  Fixed bug #29795 (SegFault with Soap and Amazon's Web Services)
  Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.59r2=1.1760.2.60ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.59 php-src/NEWS:1.1760.2.60
--- php-src/NEWS:1.1760.2.59Thu Aug 26 08:20:12 2004
+++ php-src/NEWSThu Aug 26 11:23:57 2004
@@ -16,6 +16,7 @@
 - Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
   data). (Ilia)
 - Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia)
+- Fixed bug #29795 (SegFault with Soap and Amazon's Web Services). (Dmitry)
 - Fixed bug #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE
   on error). (Tony)
 - Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob)
@@ -25,6 +26,8 @@
   (Christian, Rob)
 - Fixed bug #29656 (segfault on result and statement properties). (Georg)
 - Fixed bug #29447 (Reflection API issues). (Marcus)
+- Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled).
+  (Dmitry)
 - Fixed bug #27791 (Apache 2.0 SAPI build against Apache 2 HEAD). (Joe Orton,
   Derick)
 - Fixed bug #26737 (private/protected properties not serialized when user
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.71.2.1r2=1.71.2.2ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.71.2.1 
php-src/ext/soap/php_encoding.c:1.71.2.2
--- php-src/ext/soap/php_encoding.c:1.71.2.1Tue Aug 10 12:30:30 2004
+++ php-src/ext/soap/php_encoding.c Thu Aug 26 11:23:57 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.71.2.1 2004/08/10 16:30:30 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.71.2.2 2004/08/26 15:23:57 dmitry Exp $ */
 
 #include time.h
 
@@ -2437,6 +2437,9 @@
sdlTypePtr type;
 
type = enc-sdl_type;
+   if (type == NULL) {
+   return guess_zval_convert(enc, data);
+   }
 /*FIXME: restriction support
if (type  type-restrictions 
data   data-children  data-children-content) {
@@ -2500,6 +2503,13 @@
 
type = enc-sdl_type;
 
+   if (type == NULL) {
+   ret = guess_xml_convert(enc, data, style, parent);
+   if (style == SOAP_ENCODED) {
+   set_ns_and_type(ret, enc);
+   }
+   return ret;
+   }
 /*FIXME: restriction support
if (type) {
if (type-restrictions  Z_TYPE_P(data) == IS_STRING) {

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29795.phpt?r=1.1p=1
Index: php-src/ext/soap/tests/bugs/bug29795.phpt
+++ php-src/ext/soap/tests/bugs/bug29795.phpt

http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug29795.wsdl?r=1.1p=1
Index: php-src/ext/soap/tests/bugs/bug29795.wsdl
+++ php-src/ext/soap/tests/bugs/bug29795.wsdl

-- 
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_encoding.c /ext/soap/tests/bugs bug29795.phpt bug29795.wsdl

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 11:26:33 2004 EDT

  Modified files:  
/php-src/ext/soap   php_encoding.c 
/php-src/ext/soap/tests/bugsbug29795.phpt bug29795.wsdl 
  Log:
  Fixed bug #29795 (SegFault with Soap and Amazon's Web Services)
  Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled)
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.72r2=1.73ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.72 php-src/ext/soap/php_encoding.c:1.73
--- php-src/ext/soap/php_encoding.c:1.72Tue Aug 10 12:11:41 2004
+++ php-src/ext/soap/php_encoding.c Thu Aug 26 11:26:32 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.72 2004/08/10 16:11:41 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.73 2004/08/26 15:26:32 dmitry Exp $ */
 
 #include time.h
 
@@ -2437,6 +2437,9 @@
sdlTypePtr type;
 
type = enc-sdl_type;
+   if (type == NULL) {
+   return guess_zval_convert(enc, data);
+   }
 /*FIXME: restriction support
if (type  type-restrictions 
data   data-children  data-children-content) {
@@ -2500,6 +2503,13 @@
 
type = enc-sdl_type;
 
+   if (type == NULL) {
+   ret = guess_xml_convert(enc, data, style, parent);
+   if (style == SOAP_ENCODED) {
+   set_ns_and_type(ret, enc);
+   }
+   return ret;
+   }
 /*FIXME: restriction support
if (type) {
if (type-restrictions  Z_TYPE_P(data) == IS_STRING) {
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29795.phpt?r1=1.1r2=1.2ty=u
Index: php-src/ext/soap/tests/bugs/bug29795.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29795.phpt:1.2
--- /dev/null   Thu Aug 26 11:26:33 2004
+++ php-src/ext/soap/tests/bugs/bug29795.phpt   Thu Aug 26 11:26:32 2004
@@ -0,0 +1,32 @@
+--TEST--
+Bug #29795 (SegFault with Soap and Amazon's Web Services)
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+class LocalSoapClient extends SoapClient {
+
+  function LocalSoapClient($wsdl, $options) {
+$this-SoapClient($wsdl, $options);
+  }
+
+  function __doRequest($request, $location, $action, $version) {
+return EOF
+?xml version=1.0 encoding=UTF-8?SOAP-ENV:Envelope 
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; 
+xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; 
+xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
+xmlns:xsd=http://www.w3.org/2001/XMLSchema;SOAP-ENV:BodyPriceAmount3995/AmountCurrencyCodeUSD/CurrencyCode/Price/SOAP-ENV:Body/SOAP-ENV:Envelope
+EOF;
+  }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)./bug29795.wsdl,array(trace=1));
+$ar=$client-GetPrice();
+echo o;
+$client = new LocalSoapClient(dirname(__FILE__)./bug29795.wsdl,array(trace=1));
+$ar=$client-GetPrice();
+echo k\n;
+?
+--EXPECT--
+ok
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug29795.wsdl?r1=1.1r2=1.2ty=u
Index: php-src/ext/soap/tests/bugs/bug29795.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug29795.wsdl:1.2
--- /dev/null   Thu Aug 26 11:26:33 2004
+++ php-src/ext/soap/tests/bugs/bug29795.wsdl   Thu Aug 26 11:26:32 2004
@@ -0,0 +1,40 @@
+definitions xmlns=http://schemas.xmlsoap.org/wsdl/; 
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; 
xmlns:xs=http://www.w3.org/2001/XMLSchema; 
xmlns:tns=http://xml.amazon.com/AWSProductData/2004-08-01; 
targetNamespace=http://xml.amazon.com/AWSProductData/2004-08-01;
+   types
+   xs:schema 
targetNamespace=http://xml.amazon.com/AWSProductData/2004-08-01; 
elementFormDefault=qualified
+   xs:complexType name=Price
+   xs:sequence
+   xs:element name=Amount type=xs:integer 
minOccurs=0/
+   xs:element name=CurrencyCode 
type=xs:string minOccurs=0/
+   /xs:sequence
+   /xs:complexType
+   /xs:schema
+   /types
+   message name=GetPriceRequest
+   /message
+   message name=GetPriceResponse
+   part name=Price type=tns:Price/
+   /message
+   portType name=AWSProductDataPortType
+   operation name=GetPrice
+   input message=tns:GetPriceRequest/
+   output message=tns:GetPriceResponse/
+   /operation
+   /portType
+   binding name=AWSProductDataBinding type=tns:AWSProductDataPortType
+   soap:binding style=document 
transport=http://schemas.xmlsoap.org/soap/http/
+   operation name=GetPrice
+   soap:operation soapAction=http://soap.amazon.com/
+   input
+   soap:body use=literal/
+   

[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/soap php_encoding.c php_encoding.h php_schema.c php_sdl.c php_sdl.h /ext/soap/tests/bugs bug29839.phpt bug29839.wsdl xml.xsd

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 14:36:47 2004 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/soap/tests/bugsbug29839.phpt bug29839.wsdl xml.xsd 

  Modified files:  
/php-srcNEWS 
/php-src/ext/soap   php_encoding.c php_encoding.h php_schema.c 
php_sdl.c php_sdl.h 
  Log:
  Fixed bug #29839 (incorrect convert (xml:lang to lang))
  
  http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.60r2=1.1760.2.61ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.60 php-src/NEWS:1.1760.2.61
--- php-src/NEWS:1.1760.2.60Thu Aug 26 11:23:57 2004
+++ php-src/NEWSThu Aug 26 14:36:46 2004
@@ -11,6 +11,7 @@
 - Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev)
 - Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
   (Dmitry)
+- Fixed bug #29839 (incorrect convert (xml:lang to lang)). (Dmitry)
 - Fixed bug #29830 (SoapServer::setClass() should not export non-public
   methods). (Dmitry)
 - Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.71.2.2r2=1.71.2.3ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.71.2.2 
php-src/ext/soap/php_encoding.c:1.71.2.3
--- php-src/ext/soap/php_encoding.c:1.71.2.2Thu Aug 26 11:23:57 2004
+++ php-src/ext/soap/php_encoding.c Thu Aug 26 14:36:46 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.71.2.2 2004/08/26 15:23:57 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.71.2.3 2004/08/26 18:36:46 dmitry Exp $ */
 
 #include time.h
 
@@ -1357,7 +1357,14 @@
if ((*attr)-fixed  
strcmp((*attr)-fixed,dummy-children-content) != 0) {

soap_error3(E_ERROR, Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not 
allowed), (*attr)-name, (*attr)-fixed, dummy-children-content);
}
-   xmlSetProp(xmlParam, 
(*attr)-name, dummy-children-content);
+   if ((*attr)-namens  
+   (type-ns == NULL 
|| strcmp((*attr)-namens, type-ns))) {
+   xmlNsPtr nsp = 
encode_add_ns(xmlParam, (*attr)-namens);
+
+   
xmlSetNsProp(xmlParam, nsp, (*attr)-name, dummy-children-content);
+   } else {
+   
xmlSetProp(xmlParam, (*attr)-name, dummy-children-content);
+   }
}
xmlUnlinkNode(dummy);
xmlFreeNode(dummy);
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.h?r1=1.35r2=1.35.2.1ty=u
Index: php-src/ext/soap/php_encoding.h
diff -u php-src/ext/soap/php_encoding.h:1.35 php-src/ext/soap/php_encoding.h:1.35.2.1
--- php-src/ext/soap/php_encoding.h:1.35Tue Feb 24 05:12:45 2004
+++ php-src/ext/soap/php_encoding.h Thu Aug 26 14:36:46 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.h,v 1.35 2004/02/24 10:12:45 dmitry Exp $ */
+/* $Id: php_encoding.h,v 1.35.2.1 2004/08/26 18:36:46 dmitry Exp $ */
 
 #ifndef PHP_ENCODING_H
 #define PHP_ENCODING_H
@@ -43,6 +43,8 @@
 #define XSD_NS_PREFIX xsd
 #define XSI_NAMESPACE http://www.w3.org/2001/XMLSchema-instance;
 #define XSI_NS_PREFIX xsi
+#define XML_NAMESPACE http://www.w3.org/XML/1998/namespace;
+#define XML_NS_PREFIX xml
 
 #define XSD_STRING 101
 #define XSD_STRING_STRING string
http://cvs.php.net/diff.php/php-src/ext/soap/php_schema.c?r1=1.49r2=1.49.2.1ty=u
Index: php-src/ext/soap/php_schema.c
diff -u php-src/ext/soap/php_schema.c:1.49 php-src/ext/soap/php_schema.c:1.49.2.1
--- php-src/ext/soap/php_schema.c:1.49  Wed May  5 06:31:26 2004
+++ php-src/ext/soap/php_schema.c   Thu Aug 26 14:36:46 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_schema.c,v 1.49 2004/05/05 10:31:26 dmitry Exp $ */
+/* $Id: php_schema.c,v 1.49.2.1 2004/08/26 18:36:46 dmitry Exp $ */
 
 #include php_soap.h
 #include 

[PHP-CVS] cvs: php-src /ext/soap php_sdl.c

2004-08-26 Thread Dmitry Stogov
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 soap.c

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 14:52:57 2004 EDT

  Modified files:  
/php-src/ext/soap   soap.c 
  Log:
  Memory leaks were fixed
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.116r2=1.117ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.116 php-src/ext/soap/soap.c:1.117
--- php-src/ext/soap/soap.c:1.116   Thu Aug 26 08:24:54 2004
+++ php-src/ext/soap/soap.c Thu Aug 26 14:52:57 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: soap.c,v 1.116 2004/08/26 12:24:54 dmitry Exp $ */
+/* $Id: soap.c,v 1.117 2004/08/26 18:52:57 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -394,6 +394,7 @@
zend_hash_add(soap_globals-defEncNs, XSD_1999_NAMESPACE, 
sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), 
XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), 
XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL);
+   zend_hash_add(soap_globals-defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), 
XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, SOAP_1_1_ENC_NAMESPACE, 
sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, 
sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, SOAP_1_2_ENC_NAMESPACE, 
sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, 
sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
 
@@ -2227,7 +2228,7 @@
zval *headers = NULL;
zval *output_headers = NULL;
zval *args;
-   zval **real_args;
+   zval **real_args = NULL;
zval **param;
int arg_count;
 
@@ -2282,18 +2283,22 @@
 
arg_count = zend_hash_num_elements(Z_ARRVAL_P(args));
 
-   real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
-   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), pos);
-   zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) param, 
pos) == SUCCESS;
-   zend_hash_move_forward_ex(Z_ARRVAL_P(args), pos)) {
-   /*zval_add_ref(param);*/
-   real_args[i++] = *param;
+   if (arg_count  0) {
+   real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
+   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), pos);
+   zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) 
param, pos) == SUCCESS;
+   zend_hash_move_forward_ex(Z_ARRVAL_P(args), pos)) {
+   /*zval_add_ref(param);*/
+   real_args[i++] = *param;
+   }
}
if (output_headers) {
array_init(output_headers);
}
do_soap_call(this_ptr, function, function_len, arg_count, real_args, 
return_value, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
-   efree(real_args);
+   if (arg_count  0) {
+   efree(real_args);
+   }
 
if (soap_headers  ! headers) {
zend_hash_destroy(soap_headers);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap soap.c

2004-08-26 Thread Dmitry Stogov
dmitry  Thu Aug 26 14:55:54 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/soap   soap.c 
  Log:
  Memory leaks were fixed.
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.3r2=1.110.2.4ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.3 php-src/ext/soap/soap.c:1.110.2.4
--- php-src/ext/soap/soap.c:1.110.2.3   Thu Aug 26 08:20:13 2004
+++ php-src/ext/soap/soap.c Thu Aug 26 14:55:54 2004
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: soap.c,v 1.110.2.3 2004/08/26 12:20:13 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.4 2004/08/26 18:55:54 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -394,6 +394,7 @@
zend_hash_add(soap_globals-defEncNs, XSD_1999_NAMESPACE, 
sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), 
XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), 
XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL);
+   zend_hash_add(soap_globals-defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), 
XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, SOAP_1_1_ENC_NAMESPACE, 
sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, 
sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
zend_hash_add(soap_globals-defEncNs, SOAP_1_2_ENC_NAMESPACE, 
sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, 
sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
 
@@ -2227,7 +2228,7 @@
zval *headers = NULL;
zval *output_headers = NULL;
zval *args;
-   zval **real_args;
+   zval **real_args = NULL;
zval **param;
int arg_count;
 
@@ -2282,18 +2283,22 @@
 
arg_count = zend_hash_num_elements(Z_ARRVAL_P(args));
 
-   real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
-   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), pos);
-   zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) param, 
pos) == SUCCESS;
-   zend_hash_move_forward_ex(Z_ARRVAL_P(args), pos)) {
-   /*zval_add_ref(param);*/
-   real_args[i++] = *param;
+   if (arg_count  0) {
+   real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
+   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), pos);
+   zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) 
param, pos) == SUCCESS;
+   zend_hash_move_forward_ex(Z_ARRVAL_P(args), pos)) {
+   /*zval_add_ref(param);*/
+   real_args[i++] = *param;
+   }
}
if (output_headers) {
array_init(output_headers);
}
do_soap_call(this_ptr, function, function_len, arg_count, real_args, 
return_value, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
-   efree(real_args);
+   if (arg_count  0) {
+   efree(real_args);
+   }
 
if (soap_headers  ! headers) {
zend_hash_destroy(soap_headers);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/dom EXPERIMENTAL

2004-08-26 Thread Rob Richards
rrichards   Thu Aug 26 16:13:33 2004 EDT

  Removed files:   
/php-src/ext/domEXPERIMENTAL 
  Log:
  not experimental
  

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/dom EXPERIMENTAL

2004-08-26 Thread Rob Richards
rrichards   Thu Aug 26 16:13:57 2004 EDT

  Removed files:   (Branch: PHP_5_0)
/php-src/ext/domEXPERIMENTAL 
  Log:
  not experimental
  

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Unmasking the error handler (was Re: [PHP-CVS] cvs: php-src /ext/dom document.c)

2004-08-26 Thread Sterling Hughes
Derick Rethans wrote:
On Wed, 25 Aug 2004, Sterling Hughes wrote:
 

That's wrong.  You should *never* require an E_WARNING to be sent
without being able to silence it, especially not on something so
unimportant.
   

It's just as wrong as trying to parse non-wellformed XML.
 

Then don't add the feature.
There are things that extensions are allowed to do (throw a warning), 
and there are things that extensions should not be allowed to do, 
unmasking the error handler is one such thing.  IMNSHO, that is a 
technical limitation for any extension distributed with PHP.

-Sterling
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS

2004-08-26 Thread Marcus Boerger
helly   Thu Aug 26 18:44:21 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
  Log:
  BFN
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.61r2=1.1760.2.62ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.61 php-src/NEWS:1.1760.2.62
--- php-src/NEWS:1.1760.2.61Thu Aug 26 14:36:46 2004
+++ php-src/NEWSThu Aug 26 18:44:20 2004
@@ -14,6 +14,7 @@
 - Fixed bug #29839 (incorrect convert (xml:lang to lang)). (Dmitry)
 - Fixed bug #29830 (SoapServer::setClass() should not export non-public
   methods). (Dmitry)
+- Fixed bug #29828 (Interfaces no longer work). (Marcus)
 - Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
   data). (Ilia)
 - Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /tests/classes interface_and_extends.phpt

2004-08-26 Thread Marcus Boerger
helly   Thu Aug 26 18:53:52 2004 EDT

  Added files: 
/php-src/tests/classes  interface_and_extends.phpt 
  Log:
  Add new test
  

http://cvs.php.net/co.php/php-src/tests/classes/interface_and_extends.phpt?r=1.1p=1
Index: php-src/tests/classes/interface_and_extends.phpt
+++ php-src/tests/classes/interface_and_extends.phpt
--TEST--
ZE2 a class cannot extend an interface 
--SKIPIF--
?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 
needed'); ?
--FILE--
?php

interface Test
{
function show();
}

class Tester extends Test
{
function show() {
echo __METHOD__ . \n;
}
}

$o = new Tester;
$o-show();

?
===DONE===
--EXPECTF--
Fatal error: Class Tester cannot extend from interfac Test in 
%sinterface_and_extends.php on line %d

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_0) /tests/classes interface_and_extends.phpt

2004-08-26 Thread Marcus Boerger
helly   Thu Aug 26 19:01:45 2004 EDT

  Added files: (Branch: PHP_5_0)
/php-src/tests/classes  interface_and_extends.phpt 
  Log:
  MFH: Add test
  

http://cvs.php.net/co.php/php-src/tests/classes/interface_and_extends.phpt?r=1.1p=1
Index: php-src/tests/classes/interface_and_extends.phpt
+++ php-src/tests/classes/interface_and_extends.phpt
--TEST--
ZE2 a class cannot extend an interface 
--SKIPIF--
?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 
needed'); ?
--FILE--
?php

interface Test
{
function show();
}

class Tester extends Test
{
function show() {
echo __METHOD__ . \n;
}
}

$o = new Tester;
$o-show();

?
===DONE===
--EXPECTF--
Fatal error: Class Tester cannot extend from interfac Test in 
%sinterface_and_extends.php on line %d

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zlib zlib_fopen_wrapper.c

2004-08-26 Thread Ilia Alshanetsky
iliaa   Thu Aug 26 19:36:05 2004 EDT

  Modified files:  
/php-src/ext/zlib   zlib_fopen_wrapper.c 
  Log:
  Fixed a nasty resource/memory/disk-space leak when opening zlib files
  via wrapper stacking ala compress.zlib://http://...
  
  
http://cvs.php.net/diff.php/php-src/ext/zlib/zlib_fopen_wrapper.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/zlib/zlib_fopen_wrapper.c
diff -u php-src/ext/zlib/zlib_fopen_wrapper.c:1.44 
php-src/ext/zlib/zlib_fopen_wrapper.c:1.45
--- php-src/ext/zlib/zlib_fopen_wrapper.c:1.44  Thu Jan  8 03:17:52 2004
+++ php-src/ext/zlib/zlib_fopen_wrapper.c   Thu Aug 26 19:36:05 2004
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: zlib_fopen_wrapper.c,v 1.44 2004/01/08 08:17:52 andi Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.45 2004/08/26 23:36:05 iliaa Exp $ */
 
 #define _GNU_SOURCE
 
@@ -27,6 +27,7 @@
 
 struct php_gz_stream_data_t{
gzFile gz_file;
+   php_stream *stream;
 };
 
 static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
@@ -74,6 +75,10 @@
ret = gzclose(self-gz_file);
self-gz_file = NULL;
}
+   if (self-stream) {
+   php_stream_close(self-stream);
+   self-stream = NULL;
+   }
}
efree(self);
 
@@ -100,7 +105,7 @@
 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, 
int options, 
  char **opened_path, 
php_stream_context *context STREAMS_DC TSRMLS_DC)
 {
-   struct php_gz_stream_data_t *self;
+   struct php_gz_stream_data_t *self = {0};
php_stream *stream = NULL, *innerstream = NULL;
 
/* sanity check the stream: it can be either read-only or write-only */
@@ -124,8 +129,9 @@
if (innerstream) {
int fd;
 
-   if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD | 
PHP_STREAM_CAST_RELEASE, (void **) fd, REPORT_ERRORS)) {
+   if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, (void 
**) fd, REPORT_ERRORS)) {
self-gz_file = gzdopen(fd, mode);
+   self-stream = innerstream;
if (self-gz_file)  {
stream = php_stream_alloc_rel(php_stream_gzio_ops, 
self, 0, mode);
if (stream) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/zlib zlib_fopen_wrapper.c

2004-08-26 Thread Ilia Alshanetsky
iliaa   Thu Aug 26 19:36:11 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/zlib   zlib_fopen_wrapper.c 
  Log:
  MFH: Fixed a nasty resource/memory/disk-space leak when opening zlib files
  via wrapper stacking ala compress.zlib://http://...
  
  
http://cvs.php.net/diff.php/php-src/ext/zlib/zlib_fopen_wrapper.c?r1=1.33.2.6r2=1.33.2.7ty=u
Index: php-src/ext/zlib/zlib_fopen_wrapper.c
diff -u php-src/ext/zlib/zlib_fopen_wrapper.c:1.33.2.6 
php-src/ext/zlib/zlib_fopen_wrapper.c:1.33.2.7
--- php-src/ext/zlib/zlib_fopen_wrapper.c:1.33.2.6  Wed Jul 23 20:03:51 2003
+++ php-src/ext/zlib/zlib_fopen_wrapper.c   Thu Aug 26 19:36:11 2004
@@ -16,7 +16,7 @@
| Hartmut Holzgraefe [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: zlib_fopen_wrapper.c,v 1.33.2.6 2003/07/24 00:03:51 iliaa Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.33.2.7 2004/08/26 23:36:11 iliaa Exp $ */
 #define IS_EXT_MODULE
 #define _GNU_SOURCE
 
@@ -26,6 +26,7 @@
 
 struct php_gz_stream_data_t{
gzFile gz_file;
+   php_stream *stream;
 };
 
 static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
@@ -70,6 +71,10 @@
ret = gzclose(self-gz_file);
self-gz_file = NULL;
}
+   if (self-stream) {
+   php_stream_close(self-stream);
+   self-stream = NULL;
+   }
}
efree(self);
 
@@ -95,7 +100,7 @@
 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode,
int options, char **opened_path, php_stream_context *context 
STREAMS_DC TSRMLS_DC)
 {
-   struct php_gz_stream_data_t *self;
+   struct php_gz_stream_data_t *self = {0};
php_stream *stream = NULL, *innerstream = NULL;
 
/* sanity check the stream: it can be either read-only or write-only */
@@ -117,8 +122,9 @@

if (innerstream) {
int fd;
-   if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD | 
PHP_STREAM_CAST_RELEASE, (void**)fd, REPORT_ERRORS)) {
+   if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, 
(void**)fd, REPORT_ERRORS)) {
self-gz_file = gzdopen(fd, mode);
+   self-stream = innerstream;
if (self-gz_file)  {
stream = php_stream_alloc_rel(php_stream_gzio_ops, 
self, 0, mode);
if (stream) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php