summaryrefslogtreecommitdiff
path: root/ext/soap/php_http.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-04-13 08:18:54 +0000
committerDmitry Stogov <dmitry@php.net>2006-04-13 08:18:54 +0000
commitfa9135ff2dcc1d080635eb2e20d3193fe02bfde1 (patch)
treeee9d37935125e9f503ceb536278f7fed3fc5e0bb /ext/soap/php_http.c
parent0699fdfb4ffd675586896c146e5b65dfa2f3d32f (diff)
downloadphp-git-fa9135ff2dcc1d080635eb2e20d3193fe02bfde1.tar.gz
Fixed bug #37054 (SoapClient Error Fetching http headers)
Diffstat (limited to 'ext/soap/php_http.c')
-rw-r--r--ext/soap/php_http.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index cb7622fdff..f18d10042c 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -417,12 +417,21 @@ try_again:
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);