@@ -52,7 +52,7 @@ HTTPClientSession::HTTPClientSession():
5252 _responseReceived (false ),
5353 _ntlmProxyAuthenticated (false )
5454{
55- _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
55+ _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
5656}
5757
5858
@@ -69,7 +69,7 @@ HTTPClientSession::HTTPClientSession(const StreamSocket& socket):
6969 _responseReceived (false ),
7070 _ntlmProxyAuthenticated (false )
7171{
72- _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
72+ _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
7373}
7474
7575
@@ -86,7 +86,7 @@ HTTPClientSession::HTTPClientSession(const SocketAddress& address):
8686 _responseReceived (false ),
8787 _ntlmProxyAuthenticated (false )
8888{
89- _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
89+ _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
9090}
9191
9292
@@ -103,7 +103,7 @@ HTTPClientSession::HTTPClientSession(const std::string& host, Poco::UInt16 port)
103103 _responseReceived (false ),
104104 _ntlmProxyAuthenticated (false )
105105{
106- _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
106+ _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
107107}
108108
109109
@@ -133,13 +133,13 @@ HTTPClientSession::HTTPClientSession(const StreamSocket& socket, const ProxyConf
133133 _expectResponseBody (false ),
134134 _responseReceived (false )
135135{
136- _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
136+ _proxySessionFactory.registerProtocol (" http" , new HTTPSessionInstantiator);
137137}
138138
139139
140140HTTPClientSession::~HTTPClientSession ()
141141{
142- _proxySessionFactory.unregisterProtocol (" http" );
142+ _proxySessionFactory.unregisterProtocol (" http" );
143143}
144144
145145
@@ -196,17 +196,17 @@ const SocketAddress& HTTPClientSession::getSourceAddress6()
196196
197197void HTTPClientSession::setProxy (const std::string& host, Poco::UInt16 port, const std::string& protocol, bool tunnel)
198198{
199- if (protocol != " http" && protocol != " https" )
200- throw IllegalStateException (" Protocol must be either http or https" );
199+ if (protocol != " http" && protocol != " https" )
200+ throw IllegalStateException (" Protocol must be either http or https" );
201201
202- if (!connected ())
202+ if (!connected ())
203203 {
204204 _proxyConfig.host = host;
205205 _proxyConfig.port = port;
206206 _proxyConfig.protocol = protocol;
207207 _proxyConfig.tunnel = tunnel;
208208 }
209- else throw IllegalStateException (" Cannot set the proxy host, port and protocol for an already connected session" );
209+ else throw IllegalStateException (" Cannot set the proxy host, port and protocol for an already connected session" );
210210}
211211
212212
@@ -230,23 +230,22 @@ void HTTPClientSession::setProxyPort(Poco::UInt16 port)
230230
231231void HTTPClientSession::setProxyProtocol (const std::string& protocol)
232232{
233- if (protocol != " http" && protocol != " https" )
234- throw IllegalStateException (" Protocol must be either http or https" );
233+ if (protocol != " http" && protocol != " https" )
234+ throw IllegalStateException (" Protocol must be either http or https" );
235235
236- if (!connected ())
237- _proxyConfig.protocol = protocol;
238- else
239- throw IllegalStateException (" Cannot set the proxy port number for an already connected session" );
236+ if (!connected ())
237+ _proxyConfig.protocol = protocol;
238+ else
239+ throw IllegalStateException (" Cannot set the proxy protocol for an already connected session" );
240240}
241241
242242
243243void HTTPClientSession::setProxyTunnel (bool tunnel)
244244{
245- if (!connected ())
246- _proxyConfig.tunnel = tunnel;
247- else
248- throw IllegalStateException (" Cannot set the proxy tunnel for an already connected session" );
249-
245+ if (!connected ())
246+ _proxyConfig.tunnel = tunnel;
247+ else
248+ throw IllegalStateException (" Cannot set the proxy tunnel for an already connected session" );
250249}
251250
252251
@@ -623,9 +622,9 @@ void HTTPClientSession::sendChallengeRequest(const HTTPRequest& request, HTTPRes
623622StreamSocket HTTPClientSession::proxyConnect ()
624623{
625624 URI proxyUri;
626- proxyUri.setScheme (getProxyProtocol ());
627- proxyUri.setHost (getProxyHost ());
628- proxyUri.setPort (getProxyPort ());
625+ proxyUri.setScheme (getProxyProtocol ());
626+ proxyUri.setHost (getProxyHost ());
627+ proxyUri.setPort (getProxyPort ());
629628
630629 SharedPtr<HTTPClientSession> proxySession (_proxySessionFactory.createClientSession (proxyUri));
631630
0 commit comments