]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/anyp/UriScheme.cc
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 23 URL Scheme parsing */
12 #include "anyp/UriScheme.h"
14 AnyP::UriScheme::UriScheme(AnyP::ProtocolType
const aScheme
, const char *img
) :
18 // image could be provided explicitly (case-sensitive)
21 else if (theScheme_
== AnyP::PROTO_UNKNOWN
)
22 // image could be actually unknown and not provided
25 else if (theScheme_
> AnyP::PROTO_NONE
&& theScheme_
< AnyP::PROTO_MAX
) {
26 // image could be implied by a registered transfer protocol
27 // which use upper-case labels, so down-case for scheme image
28 image_
= AnyP::ProtocolType_str
[theScheme_
];
31 // else, image is an empty string ("://example.com/")
35 AnyP::UriScheme::defaultPort() const
39 case AnyP::PROTO_HTTP
:
42 case AnyP::PROTO_HTTPS
:
48 case AnyP::PROTO_COAP
:
49 case AnyP::PROTO_COAPS
:
50 // coaps:// default is TBA as of draft-ietf-core-coap-08.
51 // Assuming IANA policy of allocating same port for base and TLS protocol versions will occur.
54 case AnyP::PROTO_GOPHER
:
57 case AnyP::PROTO_WAIS
:
60 case AnyP::PROTO_CACHE_OBJECT
:
61 return CACHE_HTTP_PORT
;
63 case AnyP::PROTO_WHOIS
: