]> git.ipfire.org Git - thirdparty/squid.git/blame - src/anyp/UriScheme.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / anyp / UriScheme.cc
CommitLineData
1ca54a54 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
bbc27441
AJ
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
14char const *
15AnyP::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}
f53969cc 31