dmitry          Tue Feb  7 12:49:10 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src    NEWS 
    /php-src/ext/soap   php_http.c php_soap.h soap.c 
    /php-src/ext/soap/tests/schema      schema075.phpt schema076.phpt 
                                        schema077.phpt schema078.phpt 
                                        schema079.phpt schema080.phpt 
  Log:
  Fixed bug #36083 (SoapClient waits for responses on one-way operations)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.405&r2=1.2027.2.406&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.405 php-src/NEWS:1.2027.2.406
--- php-src/NEWS:1.2027.2.405   Tue Feb  7 00:38:15 2006
+++ php-src/NEWS        Tue Feb  7 12:49:09 2006
@@ -51,6 +51,8 @@
   (Tony)
 - Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed). 
   (Tony)
+- Fixed bug #36083 (SoapClient waits for responses on one-way operations).
+  (Dmitry)
 - Fixed bug #36071 (Engine Crash related with 'clone'). (Dmitry)
 - Fixed bug #36055 (possible OCI8 crash in multithreaded environment). (Tony)
 - Fixed bug #36046 (parse_ini_file() miscounts lines in multi-line values).
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.7&r2=1.77.2.8&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.7 
php-src/ext/soap/php_http.c:1.77.2.8
--- php-src/ext/soap/php_http.c:1.77.2.7        Mon Feb  6 10:16:03 2006
+++ php-src/ext/soap/php_http.c Tue Feb  7 12:49:09 2006
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_http.c,v 1.77.2.7 2006/02/06 10:16:03 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.8 2006/02/07 12:49:09 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -679,6 +679,13 @@
                return FALSE;
        }
 
+       if (!buffer) {
+               php_stream_close(stream);
+               zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
+               zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
+               return TRUE;
+       }
+
        do {
                if (!get_http_headers(stream, &http_headers, &http_header_size 
TSRMLS_CC)) {
                        if (http_headers) {efree(http_headers);}
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_soap.h?r1=1.38.2.2&r2=1.38.2.3&diff_format=u
Index: php-src/ext/soap/php_soap.h
diff -u php-src/ext/soap/php_soap.h:1.38.2.2 
php-src/ext/soap/php_soap.h:1.38.2.3
--- php-src/ext/soap/php_soap.h:1.38.2.2        Thu Feb  2 11:41:45 2006
+++ php-src/ext/soap/php_soap.h Tue Feb  7 12:49:09 2006
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_soap.h,v 1.38.2.2 2006/02/02 11:41:45 dmitry Exp $ */
+/* $Id: php_soap.h,v 1.38.2.3 2006/02/07 12:49:09 dmitry Exp $ */
 
 #ifndef PHP_SOAP_H
 #define PHP_SOAP_H
@@ -153,6 +153,7 @@
 #define SOAP_AUTHENTICATION_DIGEST  1
 
 #define SOAP_SINGLE_ELEMENT_ARRAYS  (1<<0)
+#define SOAP_WAIT_ONE_WAY_CALLS     (2<<0)
 
 ZEND_BEGIN_MODULE_GLOBALS(soap)
        HashTable  defEncNs;     /* mapping of default namespaces to prefixes */
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/soap.c?r1=1.156.2.14&r2=1.156.2.15&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.14 php-src/ext/soap/soap.c:1.156.2.15
--- php-src/ext/soap/soap.c:1.156.2.14  Mon Feb  6 11:28:41 2006
+++ php-src/ext/soap/soap.c     Tue Feb  7 12:49:09 2006
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: soap.c,v 1.156.2.14 2006/02/06 11:28:41 tony2001 Exp $ */
+/* $Id: soap.c,v 1.156.2.15 2006/02/07 12:49:09 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -635,6 +635,7 @@
        REGISTER_STRING_CONSTANT("XSD_1999_NAMESPACE", XSD_1999_NAMESPACE,  
CONST_CS | CONST_PERSISTENT);
 
        REGISTER_LONG_CONSTANT("SOAP_SINGLE_ELEMENT_ARRAYS", 
SOAP_SINGLE_ELEMENT_ARRAYS, CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("SOAP_WAIT_ONE_WAY_CALLS", 
SOAP_WAIT_ONE_WAY_CALLS, CONST_CS | CONST_PERSISTENT);
 
        old_error_handler = zend_error_cb;
        zend_error_cb = soap_error_handler;
@@ -2202,7 +2203,7 @@
                }
 
                if (zend_hash_find(ht, "features", sizeof("features"), 
(void**)&tmp) == SUCCESS &&
-                       Z_TYPE_PP(tmp) == IS_ARRAY) {
+                       Z_TYPE_PP(tmp) == IS_LONG) {
                        add_property_long(this_ptr, "_features", 
Z_LVAL_PP(tmp));
            }
 
@@ -2241,13 +2242,13 @@
 }
 /* }}} */
 
-static int do_request(zval *this_ptr, xmlDoc *request, char *location, char 
*action, int version, zval *response TSRMLS_DC)
+static int do_request(zval *this_ptr, xmlDoc *request, char *location, char 
*action, int version, int one_way, zval *response TSRMLS_DC)
 {
        int    ret = TRUE;
        char  *buf;
        int    buf_size;
-       zval   func, param0, param1, param2, param3;
-       zval  *params[4];
+       zval   func, param0, param1, param2, param3, param4;
+       zval  *params[5];
        zval **trace;
        zval **fault;
 
@@ -2287,7 +2288,11 @@
        params[3] = &param3;
        ZVAL_LONG(params[3], version);
 
-       if (call_user_function(NULL, &this_ptr, &func, response, 4, params 
TSRMLS_CC) != SUCCESS) {
+       INIT_ZVAL(param4);
+       params[4] = &param4;
+       ZVAL_LONG(params[4], one_way);
+
+       if (call_user_function(NULL, &this_ptr, &func, response, 5, params 
TSRMLS_CC) != SUCCESS) {
                add_soap_fault(this_ptr, "Client", "SoapSlient::__doRequest() 
failed", NULL, NULL TSRMLS_CC);
                ret = FALSE;
        } else if (Z_TYPE_P(response) != IS_STRING) {
@@ -2388,16 +2393,24 @@
                fn = get_function(sdl, function);
                if (fn != NULL) {
                        sdlBindingPtr binding = fn->binding;
+                       int one_way = 0;
+
+                       if (fn->responseName == NULL &&
+                           fn->responseParameters == NULL &&
+                           soap_headers == NULL) {
+                               one_way = 1;
+                       }
+
                        if (location == NULL) {
                                location = binding->location;
                        }
                        if (binding->bindingType == BINDING_SOAP) {
                                sdlSoapBindingFunctionPtr fnb = 
(sdlSoapBindingFunctionPtr)fn->bindingAttributes;
                                request = serialize_function_call(this_ptr, fn, 
NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers 
TSRMLS_CC);
-                               ret = do_request(this_ptr, request, location, 
fnb->soapAction, soap_version, &response TSRMLS_CC);
+                               ret = do_request(this_ptr, request, location, 
fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
                        }       else {
                                request = serialize_function_call(this_ptr, fn, 
NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers 
TSRMLS_CC);
-                               ret = do_request(this_ptr, request, location, 
NULL, soap_version, &response TSRMLS_CC);
+                               ret = do_request(this_ptr, request, location, 
NULL, soap_version, one_way, &response TSRMLS_CC);
                        }
 
                        xmlFreeDoc(request);
@@ -2440,7 +2453,7 @@
                        }
                        smart_str_0(&action);
 
-                       ret = do_request(this_ptr, request, location, action.c, 
soap_version, &response TSRMLS_CC);
+                       ret = do_request(this_ptr, request, location, action.c, 
soap_version, 0, &response TSRMLS_CC);
 
                        smart_str_free(&action);
                        xmlFreeDoc(request);
@@ -2737,15 +2750,21 @@
   char *buf, *location, *action;
   int   buf_size, location_size, action_size;
   long  version;
+  long  one_way = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl",
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|l",
            &buf, &buf_size,
            &location, &location_size,
            &action, &action_size,
-           &version) == FAILURE) {
+           &version, &one_way) == FAILURE) {
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
        }
-       if (make_http_soap_request(this_ptr, buf, buf_size, location, action, 
version,
+       if (SOAP_GLOBAL(features) & SOAP_WAIT_ONE_WAY_CALLS) {
+               one_way = 0;
+       }
+       if (one_way && make_http_soap_request(this_ptr, buf, buf_size, 
location, action, version, NULL, NULL TSRMLS_CC)) {
+               RETURN_EMPTY_STRING();
+       } else if (make_http_soap_request(this_ptr, buf, buf_size, location, 
action, version,
            &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC)) {
                return_value->type = IS_STRING;
                return;
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema075.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema075.phpt
diff -u php-src/ext/soap/tests/schema/schema075.phpt:1.1 
php-src/ext/soap/tests/schema/schema075.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema075.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema075.phpt        Tue Feb  7 12:49:09 2006
@@ -19,7 +19,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/"; 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/"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:test><testParam
 ns1:int1="1" ns1:int2="2" int3="3" 
xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema076.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema076.phpt
diff -u php-src/ext/soap/tests/schema/schema076.phpt:1.1 
php-src/ext/soap/tests/schema/schema076.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema076.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema076.phpt        Tue Feb  7 12:49:09 2006
@@ -19,7 +19,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/"; 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/"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:test><testParam
 int1="1" ns1:int2="2" int3="3" 
xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema077.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema077.phpt
diff -u php-src/ext/soap/tests/schema/schema077.phpt:1.1 
php-src/ext/soap/tests/schema/schema077.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema077.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema077.phpt        Tue Feb  7 12:49:09 2006
@@ -19,7 +19,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/"; 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/"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:test><testParam
 int1="1" ns1:int2="2" int3="3" 
xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema078.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema078.phpt
diff -u php-src/ext/soap/tests/schema/schema078.phpt:1.1 
php-src/ext/soap/tests/schema/schema078.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema078.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema078.phpt        Tue Feb  7 12:49:10 2006
@@ -21,7 +21,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/";><SOAP-ENV:Body><ns1:test><testParam><ns1:int1>1</ns1:int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema079.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema079.phpt
diff -u php-src/ext/soap/tests/schema/schema079.phpt:1.1 
php-src/ext/soap/tests/schema/schema079.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema079.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema079.phpt        Tue Feb  7 12:49:10 2006
@@ -21,7 +21,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/";><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/tests/schema/schema080.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/schema080.phpt
diff -u php-src/ext/soap/tests/schema/schema080.phpt:1.1 
php-src/ext/soap/tests/schema/schema080.phpt:1.1.4.1
--- php-src/ext/soap/tests/schema/schema080.phpt:1.1    Wed Apr 20 08:30:43 2005
+++ php-src/ext/soap/tests/schema/schema080.phpt        Tue Feb  7 12:49:10 2006
@@ -21,7 +21,7 @@
 --EXPECTF--
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://test-uri/";><SOAP-ENV:Body><ns1:test><testParam><int1>1</int1><ns1:int2>2</ns1:int2><int3>3</int3></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
-object(stdClass)#5 (3) {
+object(stdClass)#%d (3) {
   ["int1"]=>
   int(1)
   ["int2"]=>

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

Reply via email to