]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix eCAP build broken by Adaptation::Config::metaHeaders change (#1987)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 21 Jan 2025 13:19:47 +0000 (13:19 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 22 Jan 2025 03:04:56 +0000 (03:04 +0000)
2024 master/v7 commit 984577ac replaced Adaptation::Config::metaHeaders
data member with a function but did not update metaHeaders users in eCAP
code.

src/adaptation/ecap/XactionRep.cc

index b7cfe0d8455f31506dc0636b84eb1875ae2db5f3..2b56d029ec649d542d52883c26e8aa08b790d208 100644 (file)
@@ -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))
@@ -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());
@@ -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();