Skip to content

Commit

Permalink
Fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Feb 3, 2025
1 parent f948cdd commit 1f4968b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions pdns/axfr-retriever.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ using pdns::resolver::parseResult;

AXFRRetriever::AXFRRetriever(const ComboAddress& remote,
const DNSName& domain,
const TSIGTriplet& tt,
const TSIGTriplet& tsigConf,
const ComboAddress* laddr,
size_t maxReceivedBytes,
uint16_t timeout) :
d_buf(65536), d_tsigVerifier(tt, remote, d_trc), d_maxReceivedBytes(maxReceivedBytes)
d_buf(65536), d_tsigVerifier(tsigConf, remote, d_trc), d_maxReceivedBytes(maxReceivedBytes)
{
ComboAddress local;
if (laddr != nullptr) {
Expand All @@ -59,17 +59,19 @@ AXFRRetriever::AXFRRetriever(const ComboAddress& remote,
vector<uint8_t> packet;
DNSPacketWriter pw(packet, domain, QType::AXFR);
pw.getHeader()->id = dns_random_uint16();

if(!tt.name.empty()) {
if (tt.algo == DNSName("hmac-md5"))
d_trc.d_algoName = tt.algo + DNSName("sig-alg.reg.int");
else
d_trc.d_algoName = tt.algo;

if (!tsigConf.name.empty()) {
if (tsigConf.algo == DNSName("hmac-md5")) {
d_trc.d_algoName = tsigConf.algo + DNSName("sig-alg.reg.int");
}
else {
d_trc.d_algoName = tsigConf.algo;
}
d_trc.d_time = time(nullptr);
d_trc.d_fudge = 300;
d_trc.d_origID=ntohs(pw.getHeader()->id);
d_trc.d_eRcode=0;
addTSIG(pw, d_trc, tt.name, tt.secret, "", false);
addTSIG(pw, d_trc, tsigConf.name, tsigConf.secret, "", false);
}

uint16_t replen=htons(packet.size());
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnswriter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private:
DNSName d_qname;

uint16_t d_truncatemarker; // end of header, for truncate
DNSResourceRecord::Place d_recordplace;
DNSResourceRecord::Place d_recordplace{DNSResourceRecord::QUESTION};
bool d_canonic{false}, d_lowerCase{false}, d_compress{false};
};

Expand Down
2 changes: 1 addition & 1 deletion pdns/webserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ WebServer::WebServer(string listenaddress, int port) :
d_listenaddress(std::move(listenaddress)),
d_port(port),
d_server(nullptr),
d_maxbodysize(2 * 1024 * 1024)
d_maxbodysize(static_cast<ssize_t>(2 * 1024 * 1024))

{
YaHTTP::Router::Map("OPTIONS", "/<*url>", [](YaHTTP::Request *req, YaHTTP::Response *resp) {
Expand Down

0 comments on commit 1f4968b

Please sign in to comment.