]>
Commit | Line | Data |
---|---|---|
1ca54a54 | 1 | /* |
bbc27441 AJ |
2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
3 | * | |
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. | |
1ca54a54 | 7 | */ |
bbc27441 AJ |
8 | |
9 | /* DEBUG: section 23 URL Scheme parsing */ | |
10 | ||
1ca54a54 AJ |
11 | #include "squid.h" |
12 | #include "anyp/UriScheme.h" | |
13 | ||
14 | char const * | |
15 | AnyP::UriScheme::c_str() const | |
16 | { | |
17 | if (theScheme_ == AnyP::PROTO_UNKNOWN) | |
18 | return "(unknown)"; | |
19 | ||
20 | static char out[BUFSIZ]; | |
21 | int p = 0; | |
22 | ||
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]); | |
27 | } | |
28 | out[p] = '\0'; | |
29 | return out; | |
30 | } |