| 296 | } |
| 297 | |
| 298 | CurlHandleManager::Handle CurlHandleManager::getHandle (RequestVerb verb, const std::string& url) |
| 299 | { |
| 300 | Handle handle (this, getCurlHandleFromCache (verb, url), verb, url); |
| 301 | |
| 302 | if (!mProxy.empty ()) |
| 303 | { |
| 304 | handle.setOption (CURLOPT_PROXY, mProxy); |
| 305 | // If we use proxy, checking the CRL will likely break the SSL proxying |
| 306 | handle.setOption (CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE); |
| 307 | } |
| 308 | |
| 309 | handle.setOption (CURLOPT_TCP_KEEPALIVE, 1L); |
| 310 | |
| 311 | handle.setOption (CURLOPT_TCP_KEEPIDLE, |
| 312 | std::chrono::duration_cast<std::chrono::seconds> (KEEP_ALIVE_IDLE).count () |
| 313 | ); |
| 314 | |
| 315 | handle.setOption (CURLOPT_TCP_KEEPINTVL, |
| 316 | std::chrono::duration_cast<std::chrono::seconds> (KEEP_ALIVE_PROBE).count () |
| 317 | ); |
| 318 | |
| 319 | return handle; |
| 320 | } |
| 321 | |
| 322 | std::string CurlHandleManager::getUserAgent () const |
| 323 | { |