From f43c44480160a6cb81fc302091554792ea12fd11 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 7 Jul 2015 22:46:26 +0200 Subject: [PATCH] remove toString() from logging --- modules/bindbackend/bindbackend2.cc | 24 ++++----- modules/tinydnsbackend/tinydnsbackend.cc | 2 +- pdns/backends/gsql/gsqlbackend.cc | 4 +- pdns/common_startup.cc | 2 +- pdns/dbdnsseckeeper.cc | 2 +- pdns/dnsbackend.cc | 8 +-- pdns/dnspacket.cc | 6 +-- pdns/dnsproxy.cc | 2 +- pdns/gss_context.cc | 8 +-- pdns/mastercommunicator.cc | 22 ++++---- pdns/packethandler.cc | 66 ++++++++++++------------ pdns/rfc2136handler.cc | 34 ++++++------ pdns/slavecommunicator.cc | 28 +++++----- pdns/tcpreceiver.cc | 20 +++---- pdns/ueberbackend.cc | 2 +- 15 files changed, 115 insertions(+), 115 deletions(-) diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index ac8cb7444..50c83feb9 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -579,7 +579,7 @@ string Bind2Backend::DLAddDomainHandler(const vector&parts, Utility::pid safePutBBDomainInfo(bbd); - L<type!="master" && i->type!="slave") { - L<type<<"' zone '"<name.toString()<<"'"<type<<"' zone '"<name<<"'"<name.toString()<<"' from file '"<filename<<"'"<name<<"' from file '"<filename<<"'"<size()<<" available in total!"<size()<<" available in total!"<qtype==qtype.getCode())) { - DLOG(L<qtype).getName()<<": '"<content<<"'"<qtype).getName()<<": '"<content<<"'"<getRemote() + "<-" + P->getRealRemote().toString(); else remote = P->getRemote(); - L << Logger::Notice<<"Remote "<< remote <<" wants '" << P->qdomain.toString()<<"|"<qtype.getName() << + L << Logger::Notice<<"Remote "<< remote <<" wants '" << P->qdomain<<"|"<qtype.getName() << "', do = " <d_dnssecOk <<", bufsize = "<< P->getMaxReplyLen()<<": "; } diff --git a/pdns/dbdnsseckeeper.cc b/pdns/dbdnsseckeeper.cc index dbb517cc2..615f2cf33 100644 --- a/pdns/dbdnsseckeeper.cc +++ b/pdns/dbdnsseckeeper.cc @@ -243,7 +243,7 @@ bool DNSSECKeeper::getNSEC3PARAM(const DNSName& zname, NSEC3PARAMRecordContent* delete tmp; if (ns3p->d_iterations > maxNSEC3Iterations) { ns3p->d_iterations = maxNSEC3Iterations; - L<list(domain, sd.domain_id))) { - DLOG(L<qname = inZone.substr( inZone.length() - foundkey.length(), string::npos ); - DLOG(L<qname.toString()<qname<getTSIGDetails(trc, keyname, &message); int64_t now = time(0); if(abs((int64_t)trc->d_time - now) > trc->d_fudge) { - L<qdomain.toString()<<"' denied: TSIG (key '"<toString()<<"') time delta "<< abs(trc->d_time - now)<<" > 'fudge' "<d_fudge<qdomain<<"' denied: TSIG (key '"<<*keyname<<"') time delta "<< abs(trc->d_time - now)<<" > 'fudge' "<d_fudge<getTSIGKey(*keyname, &algoName, &secret64)) { - L<qdomain.toString()<<"' denied: can't find TSIG key with name '"<toString()<<"' and algorithm '"<qdomain<<"' denied: can't find TSIG key with name '"<<*keyname<<"' and algorithm '"<d_algoName == "hmac-md5") @@ -662,7 +662,7 @@ bool checkForCorrectTSIG(const DNSPacket* q, UeberBackend* B, DNSName* keyname, B64Decode(secret64, *secret); bool result=calculateHMAC(*secret, message, algo) == trc->d_mac; if(!result) { - L<qdomain.toString()<<"' denied: TSIG signature mismatch using '"<toString()<<"' and algorithm '"<d_algoName.toString()<<"'"<qdomain<<"' denied: TSIG signature mismatch using '"<<*keyname<<"' and algorithm '"<d_algoName<<"'"<second.qtype || p.qdomain != i->second.qname) { L<second.qtype<<", "<second.qname.toString()<<")"<second.qtype<<", "<second.qname<<")"<::const_iterator j=nsset.begin();j!=nsset.end();++j) { vector nsips=fns.lookup(*j, B); if(nsips.empty()) - L<::const_iterator k=nsips.begin();k!=nsips.end();++k) { const ComboAddress caIp(*k, 53); if(!d_preventSelfNotification || !AddressIsUs(caIp)) { if(!d_onlyNotify.match(&caIp)) - L<::const_iterator j=ips.begin();j!=ips.end();++j) { - L<::const_iterator j=alsoNotify.begin();j!=alsoNotify.end();++j) { try { const ComboAddress caIp(*j, 53); - L< PacketHandler::getBestDNAMESynth(DNSPacket *p, SOAData DNSName prefix; DNSName subdomain(target); do { - DLOG(L<<"Attempting DNAME lookup for "<qname.toString()<<" ("<qname<<" ("<qdomain.toString()<<" at: "<< p->getRemote() <<": "<qdomain<<" at: "<< p->getRemote() <<": "<qdomain.toString()<<" at: "<< p->getRemote()<qdomain<<" at: "<< p->getRemote()<getRemote(), p->qdomain, nsset, &nameserver, &account, &db)) { - L<qdomain.toString()<<" for potential supermaster "<getRemote()<<". Remote nameservers: "<qdomain<<" for potential supermaster "<getRemote()<<". Remote nameservers: "<createSlaveDomain(p->getRemote(), p->qdomain, nameserver, account); } catch(PDNSException& ae) { - L<qdomain.toString()<<" for potential supermaster "<getRemote()<<": "<qdomain<<" for potential supermaster "<getRemote()<<": "<qdomain.toString()<<"' from supermaster "<getRemote()<qdomain<<"' from supermaster "<getRemote()< do stuff */ if(!::arg().mustDo("slave")) { - L<qdomain.toString()<<" from "<getRemote()<<" but slave support is disabled in the configuration"<qdomain<<" from "<getRemote()<<" but slave support is disabled in the configuration"<d_remote )) { - L<qdomain.toString()<<" from "<getRemote()<<" but remote is not in allow-notify-from"<qdomain<<" from "<getRemote()<<" but remote is not in allow-notify-from"<qdomain, di) || !(db=di.backend)) { - L<qdomain.toString()<<" from "<getRemote()<<" for which we are not authoritative"<qdomain<<" from "<getRemote()<<" for which we are not authoritative"<getRemote())) { - L<qdomain.toString()<<" from trusted-notification-proxy "<< p->getRemote()<qdomain<<" from trusted-notification-proxy "<< p->getRemote()<qdomain.toString()<<" does not have any masters defined"<qdomain<<" does not have any masters defined"<isMaster(p->qdomain, p->getRemote())) { - L<qdomain.toString()<<" from "<getRemote()<<" which is not a master"<qdomain<<" from "<getRemote()<<" which is not a master"<qname.toString()<qname<qname.toString()<qname<d_tsig_algo == TSIG_GSS) { GssContext gssctx(keyname.toStringNoDot()); if (!gssctx.getPeerPrincipal(p->d_peer_principal)) { - L<qdomain)) { // if(d_logDNSDetails) - // L<getRemote()<<", '"<qdomain.toString()<<"': sending servfail"<getRemote()<<", '"<qdomain<<"': sending servfail"<d_remote); // S.inc("servfail-packets"); @@ -1115,13 +1115,13 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) return 0; } - L<d.opcode<<" from "<getRemote()<<" for "<qdomain.toString()<d.opcode<<" from "<getRemote()<<" for "<qdomain<setRcode(RCode::NotImp); return r; } - // L<qdomain.toString()<<"' "<qtype.getName()<<" from "<getRemote()<< " (tcp="<d_tcp<<")"<qdomain<<"' "<qtype.getName()<<" from "<getRemote()<< " (tcp="<d_tcp<<")"<d.ra = (p->d.rd && d_doRecursion && DP->recurseFor(p)); // make sure we set ra if rd was set, and we'll do it @@ -1160,7 +1160,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) retargeted:; if(retargetcount > 10) { // XXX FIXME, retargetcount++? - L<qdomain.toString()<<"'"<qdomain<<"'"<replyPacket(); r->setRcode(RCode::ServFail); @@ -1168,7 +1168,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) } if(!B.getAuth(p, &sd, target)) { - DLOG(L<d.ra) { DLOG(L<getRemote()<getRemote()<setRcode(RCode::NotImp); goto sendit; } @@ -1284,7 +1284,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) } - DLOG(L<<"After first ANY query for '"<qtype.getCode() == QType::DS && weHaveUnauth && !weDone && !weRedirected && d_dk.isSecuredZone(sd.qname)) { DLOG(L<<"Q for DS of a name for which we do have NS, but for which we don't have on a zone with DNSSEC need to provide an AUTH answer that proves we don't"<completePacket(r, haveAlias, target); return 0; } @@ -1371,9 +1371,9 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) goto sendit; // check whether this could be fixed easily // if (*(rr.qname.rbegin()) == '.') { - // L<qdomain.toString()<<"|"<qtype.getCode()<<"): you have a trailing dot, this could be the problem (or run pdnssec rectify-zone " <qdomain<<"|"<qtype.getCode()<<"): you have a trailing dot, this could be the problem (or run pdnssec rectify-zone " <qdomain.toString()<<"|"<qtype.getCode()<<"): please run pdnssec rectify-zone "<qdomain<<"|"<qtype.getCode()<<"): please run pdnssec rectify-zone "<d_type); if (rrType == QType::NSEC || rrType == QType::NSEC3) { - L<d_label.toString()<<"|"<d_label<<"|"<d_label.toString()<<"|"<d_label<<"|"<d_label != di->zone) { - L<d_label.toString()<<"|"<d_label<<"|"<d_class == QClass::IN) { // 3.4.2.2 QClass::IN means insert or update - DLOG(L<d_label.toString()<<"|"<d_label<<"|"<backend->replaceRRSet(di->id, oldRec->qname, oldRec->qtype, rrset); *updatedSerial = true; changedRecords++; - L<d_label.toString()<<"|"<d_label<<"|"< 0) { di->backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label.toString()<<"|"<d_label<<"|"<d_label.toString()<<"|"<d_label<<"|"< 0) { di->backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label.toString()<<"|"<d_label<<"|"<d_label.toString()<<"|"<d_label<<"|"<d_label.toString()<<"|"<d_label<<"|"<d_label); // always remove any ENT's in the place where we're going to add a record. DNSResourceRecord newRec(*rr); newRec.domain_id = di->id; @@ -342,7 +342,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, // If we insert an NS, all the records below it become non auth - so, we're inserting a delegate. // Auth can only be false when the rr->d_label is not the zone if (auth == false && rrType == QType::NS) { - DLOG(L<d_label.toString()<d_label< qnames; di->backend->listSubZone(rr->d_label, di->id); @@ -378,7 +378,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, // Delete records - section 3.4.2.3 and 3.4.2.4 with the exception of the 'always leave 1 NS rule' as that's handled by // the code that calls this performUpdate(). if ((rr->d_class == QClass::ANY || rr->d_class == QClass::NONE) && rrType != QType::SOA) { // never delete a SOA. - DLOG(L<d_label.toString()<<"; QClasse:"<d_class<<"; rrType: "<d_label<<"; QClasse:"<d_class<<"; rrType: "<backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label.toString()<<"|"<d_label<<"|"<d_label.toString()<<"|"<d_label<<"|"<qdomain, di) || !di.backend) { - L<qdomain.toString()<<"' (or backend does not support DNS update operation)"<qdomain<<"' (or backend does not support DNS update operation)"<startTransaction(p->qdomain, -1)) { // Not giving the domain_id means that we do not delete the existing records. - L<qdomain.toString()<<" does not support transaction. Can't do Update packet."<qdomain<<" does not support transaction. Can't do Update packet."<qname.isPartOf(domain)) { - L<qname.toString()<<"'|"<qtype.getName()<<" during AXFR of zone '"<qname<<"'|"<qtype.getName()<<" during AXFR of zone '"<startTransaction(domain, domain_id); - L< maxent) { - L<getDomainInfo(di.zone, di)) { - L<setFresh(di.id); } else { diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index c64f00fd8..4e30bff3e 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -558,7 +558,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou if(q->d_dnssecOk) outpacket->d_dnssecOk=true; // RFC 5936, 2.2.5 'SHOULD' - L<getRemote()<getRemote()< q, int ou } if (!canDoAXFR(q)) { - L<getRemote()<<" cannot request AXFR"<getRemote()<<" cannot request AXFR"<setRcode(9); // 'NOTAUTH' sendPacket(outpacket,outsock); return 0; @@ -579,7 +579,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou // canDoAXFR does all the ACL checks, and has the if(disable-axfr) shortcut, call it first. if(!s_P->getBackend()->getSOAUncached(target, sd)) { - L<setRcode(9); // 'NOTAUTH' sendPacket(outpacket,outsock); return 0; @@ -588,7 +588,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou UeberBackend db; if(!db.getSOAUncached(target, sd)) { - L<setRcode(RCode::NotAuth); sendPacket(outpacket,outsock); return 0; @@ -606,13 +606,13 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou if(dk.getNSEC3PARAM(target, &ns3pr, &narrow)) { NSEC3Zone=true; if(narrow) { - L<getRemote()<getRemote()<getRemote()<getRemote()<setRcode(RCode::Refused); // FIXME: should actually figure out if we are auth over a zone, and send out 9 if we aren't sendPacket(outpacket,outsock); @@ -735,7 +735,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou } rrs.push_back(rr); } else { - L< q, int outsock) UeberBackend db; if(!db.getSOAUncached(target, sd)) { - L<setRcode(RCode::NotAuth); sendPacket(outpacket,outsock); return 0; @@ -1083,12 +1083,12 @@ int TCPNameserver::doIXFR(shared_ptr q, int outsock) sendPacket(outpacket, outsock); - L<getRemote()<<" finished"<getRemote()<<" finished"<qdomain, q, outsock); } diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 320d75582..6cd4b8fd2 100644 --- a/pdns/ueberbackend.cc +++ b/pdns/ueberbackend.cc @@ -518,7 +518,7 @@ void UeberBackend::lookup(const QType &qtype,const DNSName &qname, DNSPacket *pk throw PDNSException("We are stale, please recycle"); } - DLOG(L<<"UeberBackend received question for "<