]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/SquidErrorData.cc
2 * Copyright (C) 1996-2021 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.
11 #include "acl/SquidErrorData.h"
13 #include "ConfigParser.h"
15 #include "error/Error.h"
20 ACLSquidErrorData::match(err_type err
)
22 CbDataListIterator
<err_type
> iter(errors
);
24 err_type localErr
= iter
.next();
25 debugs(28, 4, "check (" << err
<< "):" << errorTypeName(err
) << " against " << errorTypeName(localErr
));
34 ACLSquidErrorData::dump() const
37 CbDataListIterator
<err_type
> iter(errors
);
39 err_type err
= iter
.next();
40 const char *errName
= errorTypeName(err
);
41 sl
.push_back(SBuf(errName
));
48 ACLSquidErrorData::parse()
50 while (char *token
= ConfigParser::NextToken()) {
51 err_type err
= errorTypeByName(token
);
54 errors
.push_back(err
);
56 debugs(28, DBG_CRITICAL
, "FATAL: Invalid squid error name");
57 if (!opt_parse_cfg_only
)
64 ACLSquidErrorData::empty() const
66 return errors
.empty();
70 ACLSquidErrorData::clone() const
73 fatal("ACLSquidError::clone: attempt to clone used ACL");
75 return new ACLSquidErrorData (*this);