com php-src: soap #69137 - Invert logic to be correct: ext/soap/php_http.c ext/soap/tests/bug69137.p hpt
| From: | Joe Watkins | Date: | Fri, 14 Oct 2016 03:56:24 +0000 |
| Subject: | com php-src: soap #69137 - Invert logic to be correct: ext/soap/php_http.c ext/soap/tests/bug69137.p hpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95227@lists.php.net to get a copy of this message | ||
Commit: 3b9ba6195db2c17147b0fed4af3398320967002f
Author: Keith Smiley <ksmiley@salesforce.com> Thu, 13 Oct 2016 23:56:24 -0400
Parents: 31cbce341c4a5017eac3239c8ff1278cb9ff3900
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3b9ba6195db2c17147b0fed4af3398320967002f
Log:
soap #69137 - Invert logic to be correct
Bugs:
https://bugs.php.net/69137
Changed paths:
M ext/soap/php_http.c
M ext/soap/tests/bug69137.phpt
Diff:
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index cb5550a..0659bd7 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -242,7 +242,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str soap_headers = {0};
/* Set peer_name or name verification will try to use the proxy server name */
- if (context && (tmp = php_stream_context_get_option(context, "ssl",
"peer_name")) != NULL) {
+ if (!context || (tmp = php_stream_context_get_option(context, "ssl",
"peer_name")) == NULL) {
ZVAL_STRING(&ssl_proxy_peer_name, phpurl->host);
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl",
"peer_name", &ssl_proxy_peer_name);
zval_ptr_dtor(&ssl_proxy_peer_name);
diff --git a/ext/soap/tests/bug69137.phpt b/ext/soap/tests/bug69137.phpt
index a4d3baa..9160b91 100644
--- a/ext/soap/tests/bug69137.phpt
+++ b/ext/soap/tests/bug69137.phpt
@@ -7,7 +7,7 @@ if (getenv("SKIP_ONLINE_TESTS")) { die("skip test requiring internet
connection"
if (!getenv('http_proxy')) { die("skip test unless an HTTP/HTTPS proxy server is
specified in http_proxy environment variable"); }
?>
--INI--
-soap.wsdl_cache_enabled=0
+soap.wsdl_cache_enabled=1
--FILE--
<?php
@@ -19,7 +19,12 @@ class IpLookup
list ($proxyHost, $proxyPort) = explode(':', str_replace('http://', '', $_ENV['http_proxy']));
+// Prime the WSDL cache because that request sets peer_name on the HTTP context
+// and masks the SOAP bug.
$testServiceWsdl = 'https://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl';
+$client = new SoapClient($testServiceWsdl);
+unset($client);
+
$parameters = [
'proxy_host' => $proxyHost,
'proxy_port' => $proxyPort,