mirror of
https://github.com/curl/curl.git
synced 2026-08-25 22:53:38 +03:00
lib: separate scheme info from protocol implementation
This allows builds know about all schemes - but only have the protocol implementations for those actually built-in. It further allows multiple protocols to reuse the same protocol setup and functions for both TLS and non-TLS implementations instead of needing two (or more) structs. The scheme information is now in 'struct Curl_scheme' and all the function pointers for each scheme/protocol implementation are in struct Curl_protocol. The URL API now always work with all known protocols. test1560: run without requiring all the protocols Closes #20351
This commit is contained in:
parent
9703dabd77
commit
fc53df4768
60 changed files with 830 additions and 1050 deletions
|
|
@ -214,9 +214,9 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val)
|
|||
str = strchr(str, ',');
|
||||
tlen = str ? (size_t)(str - token) : strlen(token);
|
||||
if(tlen) {
|
||||
const struct Curl_handler *h = Curl_getn_scheme_handler(token, tlen);
|
||||
const struct Curl_scheme *h = Curl_getn_scheme(token, tlen);
|
||||
|
||||
if(!h)
|
||||
if(!h || !h->run)
|
||||
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||
|
||||
*val |= h->protocol;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue