| 240 | } |
| 241 | return Result(true); |
| 242 | } |
| 243 | |
| 244 | bool HttpAsyncClient::canReuseConnectionFor(StringSpan protocol, StringSpan host, uint16_t port) const |
| 245 | { |
| 246 | return hasOpenConnection and currentPort == port and currentProtocol == protocol and currentHost == host; |
| 247 | } |
| 248 | |
| 249 | Result HttpAsyncClient::ensureConnected() |
| 250 | { |
| 251 | if (not hasOpenConnection) |
| 252 | { |
| 253 | return externalConnector.isValid() ? beginExternalConnection() : beginSocketConnection(); |
| 254 | } |
| 255 | if (canReuseConnectionFor(currentURL.protocol, currentURL.host, currentURL.port)) |
| 256 | { |