summaryrefslogtreecommitdiff
path: root/ext/soap/php_sdl.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2012-03-21 16:32:49 +0400
committerDmitry Stogov <dmitry@zend.com>2012-03-21 16:32:49 +0400
commit657547f8c4758efcf85c73fec6d7fd8b3983d7cb (patch)
treea4c95b1c667afdd01ab9dabeb7619570bf0b7234 /ext/soap/php_sdl.c
parent944e622821ebd8ab62bcb3513f6b9e7bcc998b04 (diff)
downloadphp-git-657547f8c4758efcf85c73fec6d7fd8b3983d7cb.tar.gz
Fixed bug #49853 (Soap Client stream context header option ignored)
Diffstat (limited to 'ext/soap/php_sdl.c')
-rw-r--r--ext/soap/php_sdl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 45aee30ac1..e85b606a37 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -3196,6 +3196,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
smart_str headers = {0};
char* key = NULL;
time_t t = time(0);
+ zend_bool has_proxy_authorization = 0;
+ zend_bool has_authorization = 0;
if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) {
uri_len = strlen(uri);
@@ -3299,10 +3301,10 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
zval_ptr_dtor(&str_proxy);
}
- proxy_authentication(this_ptr, &headers TSRMLS_CC);
+ has_proxy_authorization = proxy_authentication(this_ptr, &headers TSRMLS_CC);
}
- basic_authentication(this_ptr, &headers TSRMLS_CC);
+ has_authorization = basic_authentication(this_ptr, &headers TSRMLS_CC);
/* Use HTTP/1.1 with "Connection: close" by default */
if (php_stream_context_get_option(context, "http", "protocol_version", &tmp) == FAILURE) {
@@ -3311,7 +3313,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
ZVAL_DOUBLE(http_version, 1.1);
php_stream_context_set_option(context, "http", "protocol_version", http_version);
zval_ptr_dtor(&http_version);
- smart_str_appendl(&headers, "Connection: close", sizeof("Connection: close")-1);
+ smart_str_appendl(&headers, "Connection: close\r\n", sizeof("Connection: close\r\n")-1);
}
if (headers.len > 0) {
@@ -3319,6 +3321,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
if (!context) {
context = php_stream_context_alloc();
+ } else {
+ http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers TSRMLS_CC);
}
smart_str_0(&headers);