From e0bea7d54152e0acd5b10c5ac616ccbad6168da7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 16 Jan 2005 08:51:52 +0000 Subject: [PATCH] Alex aka WindEagle pointed out that when doing "curl -v dictionary.com", curl assumed this used the DICT protocol. While guessing protocols will remain fuzzy, I've now made sure that the host names must start with "[protocol]." for them to be a valid guessable name. I also removed "https" as a prefix that indicates HTTPS, since we hardly ever see any host names using that. --- CHANGES | 7 +++++++ lib/url.c | 12 +++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index a5c5aa3ed..08b0149bc 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,13 @@ Changelog +Daniel (16 January 2005) +- Alex aka WindEagle pointed out that when doing "curl -v dictionary.com", curl + assumed this used the DICT protocol. While guessing protocols will remain + fuzzy, I've now made sure that the host names must start with "[protocol]." + for them to be a valid guessable name. I also removed "https" as a prefix + that indicates HTTPS, since we hardly ever see any host names using that. + Daniel (13 January 2005) - Inspired by Martijn Koster's patch and example source at http://www.greenhills.co.uk/mak/gentoo/curl-eintr-bug.c, I now made the diff --git a/lib/url.c b/lib/url.c index 67e634077..f634d2835 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2356,21 +2356,19 @@ static CURLcode CreateConnection(struct SessionHandle *data, /* Note: if you add a new protocol, please update the list in * lib/version.c too! */ - if(checkprefix("GOPHER", conn->host.name)) + if(checkprefix("GOPHER.", conn->host.name)) strcpy(conn->protostr, "gopher"); #ifdef USE_SSLEAY - else if(checkprefix("HTTPS", conn->host.name)) - strcpy(conn->protostr, "https"); else if(checkprefix("FTPS", conn->host.name)) strcpy(conn->protostr, "ftps"); #endif /* USE_SSLEAY */ - else if(checkprefix("FTP", conn->host.name)) + else if(checkprefix("FTP.", conn->host.name)) strcpy(conn->protostr, "ftp"); - else if(checkprefix("TELNET", conn->host.name)) + else if(checkprefix("TELNET.", conn->host.name)) strcpy(conn->protostr, "telnet"); - else if (checkprefix("DICT", conn->host.name)) + else if (checkprefix("DICT.", conn->host.name)) strcpy(conn->protostr, "DICT"); - else if (checkprefix("LDAP", conn->host.name)) + else if (checkprefix("LDAP.", conn->host.name)) strcpy(conn->protostr, "LDAP"); else { strcpy(conn->protostr, "http");