From c365f2cb4ffcbef02d2e9a5e17aa9d7f1fe81df7 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Thu, 21 May 2020 15:00:11 -0400 Subject: Add gemini protocol support The gemini protocol's "speculative specification" is documented at the following URLs: https://gemini.circumlunar.space/docs/spec-spec.txt gopher://gemini.circumlunar.space/1/docs/spec-spec.txt gemini://gemini.circumlunar.space/docs/spec-spec.txt This patch introduces preliminary support for version 0.11.0 of the specification, as of March 1st 2020. --- lib/url.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 0173dc88a..e2b63cf72 100644 --- a/lib/url.c +++ b/lib/url.c @@ -113,6 +113,7 @@ bool curl_win32_idn_to_ascii(const char *in, char **out); #include "inet_ntop.h" #include "http_ntlm.h" #include "curl_rtmp.h" +#include "gemini.h" #include "gopher.h" #include "mqtt.h" #include "http_proxy.h" @@ -145,7 +146,7 @@ static unsigned int get_protocol_family(unsigned int protocol); * Protocol table. Schemes (roughly) in 2019 popularity order: * * HTTPS, HTTP, FTP, FTPS, SFTP, FILE, SCP, SMTP, LDAP, IMAPS, TELNET, IMAP, - * LDAPS, SMTPS, TFTP, SMB, POP3, GOPHER POP3S, RTSP, RTMP, SMBS, DICT + * LDAPS, SMTPS, TFTP, SMB, POP3, GOPHER POP3S, RTSP, RTMP, SMBS, DICT, GEMINI */ static const struct Curl_handler * const protocols[] = { @@ -249,6 +250,10 @@ static const struct Curl_handler * const protocols[] = { &Curl_handler_dict, #endif +#ifndef CURL_DISABLE_GEMINI + &Curl_handler_gemini, +#endif + (struct Curl_handler *) NULL }; @@ -4093,6 +4098,10 @@ static unsigned int get_protocol_family(unsigned int protocol) family = CURLPROTO_GOPHER; break; + case CURLPROTO_GEMINI: + family = CURLPROTO_GEMINI; + break; + case CURLPROTO_SMB: case CURLPROTO_SMBS: family = CURLPROTO_SMB; -- cgit v1.2.3