From f3e91ed60137d0246c800da532478be11a4b7c48 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 27 Nov 2015 12:25:57 +0200 Subject: [PATCH] Support content interpolation --- modules/geoipbackend/geoipbackend.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/geoipbackend/geoipbackend.cc b/modules/geoipbackend/geoipbackend.cc index cb193cd7c..773efacd4 100644 --- a/modules/geoipbackend/geoipbackend.cc +++ b/modules/geoipbackend/geoipbackend.cc @@ -261,11 +261,10 @@ void GeoIPBackend::lookup(const QType &qtype, const DNSName& qdomain, DNSPacket auto i = dom.records.find(search); if (i != dom.records.end()) { // return static value - // we want MUTABLE rr here. - for(DNSResourceRecord rr : i->second) { + for(const auto& rr : i->second) { if (qtype == QType::ANY || rr.qtype == qtype) { - rr.content = format2str(rr.content, ip, v6, &gl); d_result.push_back(rr); + d_result.back().content = format2str(rr.content, ip, v6, &gl); d_result.back().qname = qdomain; } } @@ -292,11 +291,10 @@ void GeoIPBackend::lookup(const QType &qtype, const DNSName& qdomain, DNSPacket // see if the record can be found auto ri = dom.records.find(DNSName(format)); if (ri != dom.records.end()) { // return static value - // we want MUTABLE rr here. - for(DNSResourceRecord rr : ri->second) { + for(const auto& rr: ri->second) { if (qtype == QType::ANY || rr.qtype == qtype) { - rr.content = format2str(rr.content, ip, v6, &gl); d_result.push_back(rr); + d_result.back().content = format2str(rr.content, ip, v6, &gl); d_result.back().qname = qdomain; } } -- 2.40.0