dmitry Wed Feb 2 05:34:22 2005 EDT Modified files: (Branch: PHP_5_0) /php-src NEWS /php-src/ext/soap php_http.c php_soap.h soap.c Log: Fixed bug #31747 (SOAP Digest Authentication doesn't work with "HTTP/1.1 100 Continue" response) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.227&r2=1.1760.2.228&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.227 php-src/NEWS:1.1760.2.228 --- php-src/NEWS:1.1760.2.227 Wed Feb 2 04:11:02 2005 +++ php-src/NEWS Wed Feb 2 05:34:21 2005 @@ -17,6 +17,8 @@ of true. (Tony) - Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia) - Fixed bug #31755 (Cannot create SOAP header in no namespace). (Dmitry) +- Fixed bug #31747 (SOAP Digest Authentication doesn't work with + "HTTP/1.1 100 Continue" response). (Dmitry) - Fixed bug #31732 (mb_get_info() causes segfault when no parameters specified). (Tony) - Fixed bug #31710 (Wrong return values for mysqli_autocommit/commit/rollback). http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.55.2.11&r2=1.55.2.12&ty=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.55.2.11 php-src/ext/soap/php_http.c:1.55.2.12 --- php-src/ext/soap/php_http.c:1.55.2.11 Wed Feb 2 04:11:03 2005 +++ php-src/ext/soap/php_http.c Wed Feb 2 05:34:21 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_http.c,v 1.55.2.11 2005/02/02 09:11:03 dmitry Exp $ */ +/* $Id: php_http.c,v 1.55.2.12 2005/02/02 10:34:21 dmitry Exp $ */ #include "php_soap.h" #include "ext/standard/base64.h" @@ -654,53 +654,46 @@ } - if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) { - efree(http_headers); - if (request != buf) {efree(request);} - 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")); - add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC); - return FALSE; - } + do { + if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) { + efree(http_headers); + if (request != buf) {efree(request);} + 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")); + add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC); + return FALSE; + } - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size, 1); - } + if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && + Z_LVAL_PP(trace) > 0) { + add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size, 1); + } - /* Check to see what HTTP status was sent */ - http_1_1 = 0; - http_status = 0; - http_version = get_http_header_value(http_headers,"HTTP/"); - if (http_version) { - char *tmp; + /* Check to see what HTTP status was sent */ + http_1_1 = 0; + http_status = 0; + http_version = get_http_header_value(http_headers,"HTTP/"); + if (http_version) { + char *tmp; - if (strncmp(http_version,"1.1", 3)) { - http_1_1 = 1; - } + if (strncmp(http_version,"1.1", 3)) { + http_1_1 = 1; + } - tmp = strstr(http_version," "); - if (tmp != NULL) { - tmp++; - http_status = atoi(tmp); - } - efree(http_version); + tmp = strstr(http_version," "); + if (tmp != NULL) { + tmp++; + http_status = atoi(tmp); + } + efree(http_version); - /* Try and get headers again */ - if (http_status == 100) { - efree(http_headers); - if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) { + /* Try and get headers again */ + if (http_status == 100) { efree(http_headers); - if (request != buf) {efree(request);} - 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")); - add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC); - return FALSE; } } - } + } while (http_status == 100); /* Grab and send back every cookie */ http://cvs.php.net/diff.php/php-src/ext/soap/php_soap.h?r1=1.33.2.2&r2=1.33.2.3&ty=u Index: php-src/ext/soap/php_soap.h diff -u php-src/ext/soap/php_soap.h:1.33.2.2 php-src/ext/soap/php_soap.h:1.33.2.3 --- php-src/ext/soap/php_soap.h:1.33.2.2 Tue Nov 16 07:13:40 2004 +++ php-src/ext/soap/php_soap.h Wed Feb 2 05:34:21 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_soap.h,v 1.33.2.2 2004/11/16 12:13:40 dmitry Exp $ */ +/* $Id: php_soap.h,v 1.33.2.3 2005/02/02 10:34:21 dmitry Exp $ */ #ifndef PHP_SOAP_H #define PHP_SOAP_H @@ -146,6 +146,9 @@ #define SOAP_COMPRESSION_GZIP 0x00 #define SOAP_COMPRESSION_DEFLATE 0x10 +#define SOAP_AUTHENTICATION_BASIC 0 +#define SOAP_AUTHENTICATION_DIGEST 1 + ZEND_BEGIN_MODULE_GLOBALS(soap) HashTable defEncNs; /* mapping of default namespaces to prefixes */ HashTable defEnc; http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.23&r2=1.110.2.24&ty=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.110.2.23 php-src/ext/soap/soap.c:1.110.2.24 --- php-src/ext/soap/soap.c:1.110.2.23 Wed Feb 2 04:11:03 2005 +++ php-src/ext/soap/soap.c Wed Feb 2 05:34:21 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.110.2.23 2005/02/02 09:11:03 dmitry Exp $ */ +/* $Id: soap.c,v 1.110.2.24 2005/02/02 10:34:21 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -537,6 +537,9 @@ REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_GZIP", SOAP_COMPRESSION_GZIP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOAP_COMPRESSION_DEFLATE", SOAP_COMPRESSION_DEFLATE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_BASIC", SOAP_AUTHENTICATION_BASIC, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SOAP_AUTHENTICATION_DIGEST", SOAP_AUTHENTICATION_DIGEST, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UNKNOWN_TYPE", UNKNOWN_TYPE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_STRING", XSD_STRING, CONST_CS | CONST_PERSISTENT); @@ -2014,6 +2017,11 @@ Z_TYPE_PP(tmp) == IS_STRING) { add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); } + if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_LONG && + Z_LVAL_PP(tmp) == SOAP_AUTHENTICATION_DIGEST) { + add_property_null(this_ptr, "_digest"); + } } if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php