dmitry Thu Apr 13 08:18:54 2006 UTC Modified files: /php-src/ext/soap php_http.c soap.c Log: Fixed bug #37054 (SoapClient Error Fetching http headers) http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_http.c?r1=1.88&r2=1.89&diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.88 php-src/ext/soap/php_http.c:1.89 --- php-src/ext/soap/php_http.c:1.88 Mon Mar 20 10:37:09 2006 +++ php-src/ext/soap/php_http.c Thu Apr 13 08:18:54 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_http.c,v 1.88 2006/03/20 10:37:09 dmitry Exp $ */ +/* $Id: php_http.c,v 1.89 2006/04/13 08:18:54 dmitry Exp $ */ #include "php_soap.h" #include "ext/standard/base64.h" @@ -417,12 +417,21 @@ smart_str_append_unsigned(&soap_headers, phpurl->port); } smart_str_append_const(&soap_headers, "\r\n" - "Connection: Keep-Alive\r\n" + "Connection: Keep-Alive\r\n"); /* "Connection: close\r\n" "Accept: text/html; text/xml; text/plain\r\n" */ - "User-Agent: PHP SOAP 0.1\r\n"); + if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + if (Z_STRLEN_PP(tmp) > 0) { + smart_str_append_const(&soap_headers, "User-Agent: "); + smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + smart_str_append_const(&soap_headers, "\r\n"); + } + } else{ + smart_str_append_const(&soap_headers, "User-Agent: PHP-SOAP/"PHP_VERSION"\r\n"); + } smart_str_append(&soap_headers, &soap_headers_z); smart_str_free(&soap_headers_z); http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/soap.c?r1=1.183&r2=1.184&diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.183 php-src/ext/soap/soap.c:1.184 --- php-src/ext/soap/soap.c:1.183 Sun Apr 9 23:38:30 2006 +++ php-src/ext/soap/soap.c Thu Apr 13 08:18:54 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.183 2006/04/09 23:38:30 andrei Exp $ */ +/* $Id: soap.c,v 1.184 2006/04/13 08:18:54 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -2278,6 +2278,11 @@ persistent = zend_is_true(*tmp); } + if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + } + } else if (wsdl == NULL) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are requred in nonWSDL mode"); return;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php