protocol source, all about protocols and uri schemes

Add protocol.h and protocol.c containing all about libcurl's
known URI schemes and their protocol handlers (so they exist).

Moves the scheme definitions from the various sources files into
protocol.c. Schemes are known and used, even of the protocol
handler is not build or just not implemented at all.

Closes #20906
This commit is contained in:
Stefan Eissing 2026-03-12 13:11:38 +01:00 committed by Daniel Stenberg
parent 32531f20f9
commit eb14705280
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
42 changed files with 1089 additions and 992 deletions

View file

@ -1569,7 +1569,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done)
/*
* TELNET protocol handler.
*/
static const struct Curl_protocol Curl_protocol_telnet = {
const struct Curl_protocol Curl_protocol_telnet = {
ZERO_NULL, /* setup_connection */
telnet_do, /* do_it */
telnet_done, /* done */
@ -1590,19 +1590,3 @@ static const struct Curl_protocol Curl_protocol_telnet = {
};
#endif /* !CURL_DISABLE_TELNET */
/*
* TELNET protocol handler.
*/
const struct Curl_scheme Curl_scheme_telnet = {
"telnet", /* scheme */
#ifdef CURL_DISABLE_TELNET
ZERO_NULL,
#else
&Curl_protocol_telnet,
#endif
CURLPROTO_TELNET, /* protocol */
CURLPROTO_TELNET, /* family */
PROTOPT_NONE | PROTOPT_NOURLQUERY, /* flags */
PORT_TELNET, /* defport */
};