From 822967e2f80a465a1b6298df4da8afbec4bb718f Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 15 Aug 2023 18:07:52 +0200 Subject: [PATCH] dnsdist: Remove a second useless check, useless static casts (cherry picked from commit 6f0a2aec1d935a59f71ac8dfb6b8c174726071c2) --- pdns/dnsdistdist/dnsdist-discovery.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-discovery.cc b/pdns/dnsdistdist/dnsdist-discovery.cc index 390fce820e..76042e3c8d 100644 --- a/pdns/dnsdistdist/dnsdist-discovery.cc +++ b/pdns/dnsdistdist/dnsdist-discovery.cc @@ -275,7 +275,7 @@ bool ServiceDiscovery::getDiscoveredConfig(const UpgradeableBackend& upgradeable const struct timeval remainingTime = {.tv_sec = backend->d_config.tcpRecvTimeout, .tv_usec = 0}; uint16_t responseSize = 0; auto got = readn2WithTimeout(sock.getHandle(), &responseSize, sizeof(responseSize), remainingTime); - if (static_cast(got) != sizeof(responseSize)) { + if (got != sizeof(responseSize)) { if (g_verbose) { warnlog("Error while waiting for the ADD upgrade response size from backend %s: %d", addr.toStringWithPort(), got); } @@ -285,7 +285,7 @@ bool ServiceDiscovery::getDiscoveredConfig(const UpgradeableBackend& upgradeable packet.resize(ntohs(responseSize)); got = readn2WithTimeout(sock.getHandle(), packet.data(), packet.size(), remainingTime); - if (got < 0 || static_cast(got) != packet.size()) { + if (got != packet.size()) { if (g_verbose) { warnlog("Error while waiting for the ADD upgrade response from backend %s: %d", addr.toStringWithPort(), got); } -- 2.47.2