Add FFI bindings for blocking network transfers via libcurl's easy interface #665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First part of binding the blocking client APIs from libcurl. There's a few ugly parts that won't map cleanly:
curl_easy_setopt_by_name
replacingcurl_easy_setopt
The plan is to export a custom wrapper API instead of the one that curl offers to set transfer options:
curl_easyoption
pointer and handle the restIf
curl_easy_setopt
isn't going to be exposed, the name can be reused. Otherwise, it could get an alias.curl_easy_getinfo_by_name
potentially replacingcurl_easy_getinfo
(?)I'd rather not duplicate
CURLINFO
even though it's not as problematic. Maybe another name-based lookup function will do? In that case, there's probably no need to deal with numeric IDs. I'll need to do some more testing first.curl_easy_ssls_export
and other callback-based APIsCallbacks really aren't something I like to see, but they just won't die. Unlike the VM, when JIT optimizations aren't disabled. It won't be an issue for curl's easy interface because it's blocking. But for parallel transfers (multi interface) and the libuv integration, there might not be any way around implementing another event/polling wrapper API. Not great?
NYI: Async DNS resolution
The blocking transfer APIs aren't going to break any speed records. So it shouldn't be a problem if DNS resolution uses the default mechanism. On Windows, it seems like
AsynchResolver
is actually enabled by default... lucky accident.Resolves #655 (once done). Still needs testing for at least the most basic use cases, and name-based lookups.