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:
Daniel Stenberg 2026-01-19 00:15:41 +01:00
parent 9703dabd77
commit fc53df4768
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
60 changed files with 830 additions and 1050 deletions

View file

@ -53,17 +53,15 @@ typedef enum {
/* bitmask of CURL_HTTP_V* values */
typedef unsigned char http_majors;
extern const struct Curl_scheme Curl_scheme_http;
extern const struct Curl_scheme Curl_scheme_https;
#ifndef CURL_DISABLE_HTTP
#ifdef USE_HTTP3
#include <stdint.h>
#endif
extern const struct Curl_handler Curl_handler_http;
#ifdef USE_SSL
extern const struct Curl_handler Curl_handler_https;
#endif
struct dynhds;