MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / connect

Method connect

base/poco/NetSSL_OpenSSL/src/HTTPSClientSession.cpp:157–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157void HTTPSClientSession::connect(const SocketAddress& address)
158{
159 bool useProxy = !getProxyHost().empty() && !bypassProxy();
160
161 if (useProxy && isProxyTunnel())
162 {
163 StreamSocket proxySocket(proxyConnect());
164 SecureStreamSocket secureSocket = SecureStreamSocket::attach(proxySocket, getHost(), _pContext, _pSession);
165 attachSocket(secureSocket);
166 if (_pContext->sessionCacheEnabled())
167 {
168 _pSession = secureSocket.currentSession();
169 }
170 }
171 else
172 {
173 SecureStreamSocket sss(socket());
174 if (sss.getPeerHostName().empty())
175 {
176 sss.setPeerHostName(useProxy ? getProxyHost() : getHost());
177 }
178 if (_pContext->sessionCacheEnabled())
179 {
180 sss.useSession(_pSession);
181 }
182 HTTPSession::connect(address);
183 if (_pContext->sessionCacheEnabled())
184 {
185 _pSession = sss.currentSession();
186 }
187 }
188}
189
190
191int HTTPSClientSession::read(char* buffer, std::streamsize length)

Callers

nothing calls this directly

Calls 8

getProxyHostFunction · 0.85
attachFunction · 0.85
connectFunction · 0.85
sessionCacheEnabledMethod · 0.80
emptyMethod · 0.45
currentSessionMethod · 0.45
setPeerHostNameMethod · 0.45
useSessionMethod · 0.45

Tested by

no test coverage detected