Skip to content

Commit 28982f9

Browse files
committed
fixed an issue with proxy connect if global proxy config is used
1 parent eb8dce4 commit 28982f9

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎Net/include/Poco/Net/HTTPClientSession.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPClientSession.h
33
//
4-
// $Id: //poco/1.4/Net/include/Poco/Net/HTTPClientSession.h#7 $
4+
// $Id: //poco/1.4/Net/include/Poco/Net/HTTPClientSession.h#8 $
55
//
66
// Library: Net
77
// Package: HTTPClient
@@ -100,6 +100,9 @@ class Net_API HTTPClientSession: public HTTPSession
100100
HTTPClientSession(const std::string& host, Poco::UInt16 port = HTTPSession::HTTP_PORT);
101101
/// Creates a HTTPClientSession using the given host and port.
102102

103+
HTTPClientSession(const std::string& host, Poco::UInt16 port, const ProxyConfig& proxyConfig);
104+
/// Creates a HTTPClientSession using the given host, port and proxy configuration.
105+
103106
virtual ~HTTPClientSession();
104107
/// Destroys the HTTPClientSession and closes
105108
/// the underlying socket.

‎Net/src/HTTPClientSession.cpp‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HTTPClientSession.cpp
33
//
4-
// $Id: //poco/1.4/Net/src/HTTPClientSession.cpp#14 $
4+
// $Id: //poco/1.4/Net/src/HTTPClientSession.cpp#15 $
55
//
66
// Library: Net
77
// Package: HTTPClient
@@ -87,6 +87,18 @@ HTTPClientSession::HTTPClientSession(const std::string& host, Poco::UInt16 port)
8787
}
8888

8989

90+
HTTPClientSession::HTTPClientSession(const std::string& host, Poco::UInt16 port, const ProxyConfig& proxyConfig):
91+
_host(host),
92+
_port(port),
93+
_proxyConfig(proxyConfig),
94+
_keepAliveTimeout(DEFAULT_KEEP_ALIVE_TIMEOUT, 0),
95+
_reconnect(false),
96+
_mustReconnect(false),
97+
_expectResponseBody(false)
98+
{
99+
}
100+
101+
90102
HTTPClientSession::~HTTPClientSession()
91103
{
92104
}
@@ -379,7 +391,8 @@ void HTTPClientSession::proxyAuthenticateImpl(HTTPRequest& request)
379391

380392
StreamSocket HTTPClientSession::proxyConnect()
381393
{
382-
HTTPClientSession proxySession(getProxyHost(), getProxyPort());
394+
ProxyConfig emptyProxyConfig;
395+
HTTPClientSession proxySession(getProxyHost(), getProxyPort(), emptyProxyConfig);
383396
proxySession.setTimeout(getTimeout());
384397
std::string targetAddress(_host);
385398
targetAddress.append(":");

0 commit comments

Comments
 (0)