]> git.ipfire.org Git - thirdparty/squid.git/blob - src/anyp/UriScheme.cc
Merged from trunk (r13356).
[thirdparty/squid.git] / src / anyp / UriScheme.cc
1 /*
2 * DEBUG: section 23 URL Scheme parsing
3 * AUTHOR: Robert Collins, Amos Jeffries
4 */
5 #include "squid.h"
6 #include "anyp/UriScheme.h"
7
8 char const *
9 AnyP::UriScheme::c_str() const
10 {
11 if (theScheme_ == AnyP::PROTO_UNKNOWN)
12 return "(unknown)";
13
14 static char out[BUFSIZ];
15 int p = 0;
16
17 if (theScheme_ > AnyP::PROTO_NONE && theScheme_ < AnyP::PROTO_MAX) {
18 const char *in = AnyP::ProtocolType_str[theScheme_];
19 for (; p < (BUFSIZ-1) && in[p] != '\0'; ++p)
20 out[p] = xtolower(in[p]);
21 }
22 out[p] = '\0';
23 return out;
24 }