Skip to content

Commit

Permalink
Fix eCAP build broken by Adaptation::Config::metaHeaders change (squi…
Browse files Browse the repository at this point in the history
…d-cache#1987)

2024 master/v7 commit 984577a replaced Adaptation::Config::metaHeaders
data member with a function but did not update metaHeaders users in eCAP
code.
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Jan 22, 2025
1 parent d2437a2 commit 53ed1a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/adaptation/ecap/XactionRep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Adaptation::Ecap::XactionRep::metaValue(const libecap::Name &name) const
HttpReply *reply = dynamic_cast<HttpReply*>(theVirginRep.raw().header);

if (name.known()) { // must check to avoid empty names matching unset cfg
for (auto h: Adaptation::Config::metaHeaders) {
for (const auto &h: Adaptation::Config::metaHeaders()) {
if (name == h->key().toStdString()) {
SBuf matched;
if (h->match(request, reply, al, matched))
Expand All @@ -217,7 +217,7 @@ Adaptation::Ecap::XactionRep::visitEachMetaHeader(libecap::NamedValueVisitor &vi
Must(request);
HttpReply *reply = dynamic_cast<HttpReply*>(theVirginRep.raw().header);

for (auto h: Adaptation::Config::metaHeaders) {
for (const auto &h: Adaptation::Config::metaHeaders()) {
SBuf matched;
if (h->match(request, reply, al, matched)) {
const libecap::Name name(h->key().toStdString());
Expand Down Expand Up @@ -246,7 +246,7 @@ Adaptation::Ecap::XactionRep::start()
// retrying=false because ecap never retries transactions
adaptHistoryId = ah->recordXactStart(service().cfg().key, current_time, false);
SBuf matched;
for (auto h: Adaptation::Config::metaHeaders) {
for (const auto &h: Adaptation::Config::metaHeaders()) {
if (h->match(request, reply, al, matched)) {
if (ah->metaHeaders == nullptr)
ah->metaHeaders = new NotePairs();
Expand Down

0 comments on commit 53ed1a9

Please sign in to comment.