From: Miod Vallat Date: Fri, 24 Oct 2025 09:38:20 +0000 (+0200) Subject: Remove unnecessary check. X-Git-Tag: rec-5.4.0-alpha1~113^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f309894e3299c47caa86cc700ac43e2bd091076;p=thirdparty%2Fpdns.git Remove unnecessary check. Signed-off-by: Miod Vallat --- diff --git a/pdns/auth-secondarycommunicator.cc b/pdns/auth-secondarycommunicator.cc index ea224b8f18..d8791f2b5c 100644 --- a/pdns/auth-secondarycommunicator.cc +++ b/pdns/auth-secondarycommunicator.cc @@ -995,21 +995,21 @@ void CommunicatorClass::suck(const ZoneName& domain, const ComboAddress& remote, } catch (DBException& re) { g_log << Logger::Error << logPrefix << "unable to feed record: " << re.reason << endl; - if (ctx.domain.backend != nullptr && transaction) { + if (transaction) { g_log << Logger::Info << logPrefix << "aborting possible open transaction" << endl; ctx.domain.backend->abortTransaction(); } } catch (const MOADNSException& mde) { g_log << Logger::Error << logPrefix << "unable to parse record (MOADNSException): " << mde.what() << endl; - if (ctx.domain.backend != nullptr && transaction) { + if (transaction) { g_log << Logger::Info << logPrefix << "aborting possible open transaction" << endl; ctx.domain.backend->abortTransaction(); } } catch (std::exception& re) { g_log << Logger::Error << logPrefix << "unable to xfr zone (std::exception): " << re.what() << endl; - if (ctx.domain.backend != nullptr && transaction) { + if (transaction) { g_log << Logger::Info << logPrefix << "aborting possible open transaction" << endl; ctx.domain.backend->abortTransaction(); } @@ -1022,14 +1022,14 @@ void CommunicatorClass::suck(const ZoneName& domain, const ComboAddress& remote, auto [newCount, nextCheck] = markAsFailed(domain); g_log << Logger::Warning << logPrefix << "unable to xfr zone (ResolverException): " << re.reason << " (This was attempt number " << newCount << ". Excluding zone from secondary-checks until " << humanTime(nextCheck) << ")" << endl; } - if (ctx.domain.backend != nullptr && transaction) { + if (transaction) { g_log << Logger::Info << "aborting possible open transaction" << endl; ctx.domain.backend->abortTransaction(); } } catch (PDNSException& ae) { g_log << Logger::Error << logPrefix << "unable to xfr zone (PDNSException): " << ae.reason << endl; - if (ctx.domain.backend != nullptr && transaction) { + if (transaction) { g_log << Logger::Info << logPrefix << "aborting possible open transaction" << endl; ctx.domain.backend->abortTransaction(); }