aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2020-05-21 15:00:11 -0400
committerBen Burwell <ben@benburwell.com>2020-05-21 18:38:31 -0400
commitc365f2cb4ffcbef02d2e9a5e17aa9d7f1fe81df7 (patch)
tree6edbb7f1c12a8afbde06a56423a1c5092a9dbacd /lib/url.c
parent5d965b48987457eb0db01c2eb65712aec37e49f5 (diff)
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.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c11
1 files changed, 10 insertions, 1 deletions
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;