summaryrefslogtreecommitdiff
path: root/ext/soap/php_http.c
diff options
context:
space:
mode:
authorPierrick Charron <pierrick@php.net>2011-11-18 13:24:35 (GMT)
committerPierrick Charron <pierrick@php.net>2011-11-18 13:24:35 (GMT)
commit34bb8d8119e6bcbcc08f46e6bbc34d1e790f3e65 (patch)
tree7137f908bf7e0ccac0018c9e94a6afab64e2b4a2 /ext/soap/php_http.c
parenta65abc12b6f9608cc995f8bc7098f1ec91442996 (diff)
downloadphp-34bb8d8119e6bcbcc08f46e6bbc34d1e790f3e65.tar.gz
Added new SoapClient option "keep_alive". FR #60329
Diffstat (limited to 'ext/soap/php_http.c')
-rw-r--r--ext/soap/php_http.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 1ca0a16..e79c537 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -433,12 +433,14 @@ try_again:
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
}
- if (http_1_1) {
+ if (!http_1_1 ||
+ (zend_hash_find(Z_OBJPROP_P(this_ptr), "_keep_alive", sizeof("_keep_alive"), (void **)&tmp) == SUCCESS &&
+ Z_LVAL_PP(tmp) == 0)) {
smart_str_append_const(&soap_headers, "\r\n"
- "Connection: Keep-Alive\r\n");
+ "Connection: close\r\n");
} else {
smart_str_append_const(&soap_headers, "\r\n"
- "Connection: close\r\n");
+ "Connection: Keep-Alive\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) {