-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d297b12 introduced eager curl handle initialization and its further reusage to leverage from connection caching. It's definitely a movement into right direction but current code has a problem: it removes all the presets from the handle with `curl_easy_reset` (though it doesn't reset caches). There's currently a bug that resets progress callback been set in `session_alloc`. I propose to move the initialization of option defaults and all the options which are not request-specific to `session_alloc` and apply it to another handle called `base_handle`. Then, each request builds a duplicate of that `base_handle` and sets request-specific options on it. Connection cache is being shared using curl shared objects. Further, I'd like to refactor `set_options_from_request` function to avoid handle duplication at all in cases when no options are overriden on request level. It'd require to rewrite all `Session` option accessors to modify on `base_handle` directly so all the session-level options will already be applied and less work needs to be done on each request. Handle duplication: https://curl.se/libcurl/c/curl_easy_duphandle.html Shared objects: https://curl.se/libcurl/c/curl_share_init.html
- Loading branch information
1 parent
9531c06
commit f529059
Showing
5 changed files
with
76 additions
and
61 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
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