const bool proxyProtocolPort = port ? port->flags.proxySurrogate : false;
if (flags.interceptTproxy && !proxyProtocolPort) {
if (Config.accessList.spoof_client_ip) {
- const auto checklist = new ACLFilledChecklist(Config.accessList.spoof_client_ip, this);
- checklist->al = al;
- checklist->syncAle(this, nullptr);
- flags.spoofClientIp = checklist->fastCheck().allowed();
- delete checklist;
+ ACLFilledChecklist checklist(Config.accessList.spoof_client_ip, this);
+ checklist.al = al;
+ checklist.syncAle(this, nullptr);
+ flags.spoofClientIp = checklist.fastCheck().allowed();
} else
flags.spoofClientIp = true;
} else
if (info.icapReply->sline.status() == Http::scNone) // failed to parse the reply; I/O err
return true;
- const auto cl = new ACLFilledChecklist(TheConfig.repeat, info.icapRequest);
- cl->updateReply(info.icapReply);
-
- bool result = cl->fastCheck().allowed();
- delete cl;
- return result;
+ ACLFilledChecklist cl(TheConfig.repeat, info.icapRequest);
+ cl.updateReply(info.icapReply);
+ return cl.fastCheck().allowed();
}
/* ICAPXactAbortInfo */
return false; // internal content "hits" cannot be blocked
{
- std::unique_ptr<ACLFilledChecklist> chl(clientAclChecklistCreate(Config.accessList.sendHit, http));
- chl->updateReply(&http->storeEntry()->mem().freshestReply());
- return !chl->fastCheck().allowed(); // when in doubt, block
+ ACLFilledChecklist chl(Config.accessList.sendHit, nullptr);
+ clientAclChecklistFill(chl, http);
+ chl.updateReply(&http->storeEntry()->mem().freshestReply());
+ return !chl.fastCheck().allowed(); // when in doubt, block
}
}
#if USE_DELAY_POOLS
for (const auto &pool: MessageDelayPools::Instance()->pools) {
if (pool->access) {
- std::unique_ptr<ACLFilledChecklist> chl(clientAclChecklistCreate(pool->access, http));
- chl->updateReply(rep);
- const auto answer = chl->fastCheck();
+ ACLFilledChecklist chl(pool->access, nullptr);
+ clientAclChecklistFill(chl, http);
+ chl.updateReply(rep);
+ const auto answer = chl.fastCheck();
if (answer.allowed()) {
writeQuotaHandler = pool->createBucket();
fd_table[clientConnection->fd].writeQuotaHandler = writeQuotaHandler;
#include "ssl/cert_validate_message.h"
#include "ssl/Config.h"
#include "ssl/helper.h"
+
+#include <optional>
#endif
Security::PeerConnector::PeerConnector(const Comm::ConnectionPointer &aServerConn, const AsyncCallback<EncryptorAnswer> &aCallback, const AccessLogEntryPointer &alp, const time_t timeout):
{
Must(Comm::IsConnOpen(serverConnection()));
- ACLFilledChecklist *check = nullptr;
Security::SessionPointer session(fd_table[serverConnection()->fd].ssl);
+ std::optional<ACLFilledChecklist> check;
if (acl_access *acl = ::Config.ssl_client.cert_error) {
- check = new ACLFilledChecklist(acl, request.getRaw());
+ check.emplace(acl, request.getRaw());
fillChecklist(*check);
}
else
errs->push_back_unique(Security::CertError(i->error_no, i->cert, i->error_depth));
}
- if (check)
- delete check;
return errs;
}