#include <algorithm>
-const SBuf HttpUpgradeProtocolAccess::ProtoOther("OTHER");
-
ProtocolView::ProtocolView(const char * const start, const size_t len):
ProtocolView(SBuf(start, len))
{
{
const auto rawProto = parser.NextToken();
if (!rawProto)
- throw TextException(ToSBuf("expected a protocol name or ", ProtoOther), Here());
+ throw TextException(ToSBuf("expected a protocol name or ", ProtoOther()), Here());
- if (ProtoOther.cmp(rawProto) == 0) {
+ if (ProtoOther().cmp(rawProto) == 0) {
aclParseAccessLine(cfg_directive, parser, &other);
return;
}
typedef std::deque<NamedGuard> NamedGuards;
/// pseudonym to specify rules for "all other protocols"
- static const SBuf ProtoOther;
+ inline static const SBuf &ProtoOther();
/// rules governing upgrades to explicitly named protocols
NamedGuards namedGuards;
for (const auto &namedGuard: namedGuards)
visitor(namedGuard.protocol, namedGuard.guard);
if (other)
- visitor(ProtoOther, other);
+ visitor(ProtoOther(), other);
}
template <typename Visitor>
seenApplicable = true; // may already be true
}
if (!seenApplicable && other) // OTHER is applicable if named rules were not
- (void)visitor(ProtoOther, other);
+ (void)visitor(ProtoOther(), other);
+}
+
+inline const SBuf &
+HttpUpgradeProtocolAccess::ProtoOther()
+{
+ static const auto proto = new SBuf("OTHER");
+ return *proto;
}
#endif /* SQUID_SRC_HTTPUPGRADEPROTOCOLACCESS_H */
HttpUpgradeProtocolAccess::~HttpUpgradeProtocolAccess() STUB
const acl_access *HttpUpgradeProtocolAccess::findGuard(const SBuf &) const STUB_RETVAL(nullptr)
void HttpUpgradeProtocolAccess::configureGuard(ConfigParser &) STUB
-const SBuf HttpUpgradeProtocolAccess::ProtoOther("STUB-OTHER");
HttpUpgradeProtocolAccess::NamedGuard::~NamedGuard() STUB_NOP
HttpUpgradeProtocolAccess::NamedGuard::NamedGuard(const char *, acl_access *): protocol("STUB-UNDEF"), proto(protocol) STUB_NOP