]>
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"
15 AnyP::UriScheme::c_str() const
17 if (theScheme_
== AnyP::PROTO_UNKNOWN
)
20 static char out
[BUFSIZ
];
23 if (theScheme_
> AnyP::PROTO_NONE
&& theScheme_
< AnyP::PROTO_MAX
) {
24 const char *in
= AnyP::ProtocolType_str
[theScheme_
];
25 for (; p
< (BUFSIZ
-1) && in
[p
] != '\0'; ++p
)
26 out
[p
] = xtolower(in
[p
]);
33 AnyP::UriScheme::defaultPort() const
37 case AnyP::PROTO_HTTP
:
40 case AnyP::PROTO_HTTPS
:
46 case AnyP::PROTO_COAP
:
47 case AnyP::PROTO_COAPS
:
48 // coaps:// default is TBA as of draft-ietf-core-coap-08.
49 // Assuming IANA policy of allocating same port for base and TLS protocol versions will occur.
52 case AnyP::PROTO_GOPHER
:
55 case AnyP::PROTO_WAIS
:
58 case AnyP::PROTO_CACHE_OBJECT
:
59 return CACHE_HTTP_PORT
;
61 case AnyP::PROTO_WHOIS
: