forked from Netflix-Skunkworks/spectatord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Originally, in the `HttpClient::perform()` method, a new `CurlHandle` was created upon every invocation, leading to subsequent calls to `curl_easy_init()` and `curl_easy_cleanup()`, as the variable went in and out of scope while it executed on the `asio::thread_pool`. This meant that there was no opportunity to reuse connections from the underlying connection pool, because it was always cleaned up. By marking the `CurlHandle` with the `thread_local` storage duration, it ensures that the same one remains in use for each thread, thus providing the means to reuse the established connection pool. Fixes Netflix-Skunkworks#51.
- Loading branch information
1 parent
79a2713
commit f51cdb2
Showing
3 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters