Skip to content

Commit 7b90513

Browse files
committed
Merge branch 'hotfix/SDK-4933-fix-http-proxy' into 'release/v8.6.0'
SDK-4933. Investigate Curl proxy related issues (Hotfix for v8.6.0) See merge request sdk/sdk!6327
2 parents e75d51a + a2e2c91 commit 7b90513

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/posix/net.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -1788,10 +1788,13 @@ void CurlHttpIO::request_proxy_ip()
17881788
NET_debug << "Resolving IPv4 address for proxy: " << proxyhost;
17891789
ares_gethostbyname(ares, proxyhost.c_str(), PF_INET, proxy_ready_callback, httpctx);
17901790
#else
1791-
// No need to resolve the proxy's IP: cURL will resolve it for us.
1792-
std::ostringstream ostream;
1793-
ostream << proxyhost << ":" << proxyport;
1794-
proxyip = ostream.str();
1791+
if (!proxyhost.empty() && proxyport)
1792+
{
1793+
// No need to resolve the proxy's IP: cURL will resolve it for us.
1794+
std::ostringstream ostream;
1795+
ostream << proxyhost << ":" << proxyport;
1796+
proxyip = ostream.str();
1797+
}
17951798
#endif
17961799
}
17971800

@@ -2165,12 +2168,14 @@ void CurlHttpIO::setproxy(const Proxy& proxy)
21652168

21662169
if (proxy.getProxyType() != Proxy::CUSTOM || !proxy.getProxyURL().size())
21672170
{
2168-
// automatic proxy is not supported
2169-
// invalidate inflight proxy changes
2171+
LOG_debug << "CurlHttpIO::setproxy: Invalid arguments. type: " << proxy.getProxyType()
2172+
<< " url: " << proxy.getProxyURL() << " Invalidating inflight proxy changes";
21702173
proxyscheme.clear();
21712174
proxyhost.clear();
2172-
2173-
// don't use a proxy
2175+
proxyport = 0;
2176+
proxyusername.clear();
2177+
proxypassword.clear();
2178+
proxytype = Proxy::NONE;
21742179
proxyurl.clear();
21752180

21762181
// send pending requests without a proxy

0 commit comments

Comments
 (0)