From: Aram Sargsyan Date: Fri, 22 Sep 2023 15:59:32 +0000 (+0000) Subject: Remove xfr->end X-Git-Tag: v9.19.18~64^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed2f06ea4de9f7538be7f5e92220b84ff522d753;p=thirdparty%2Fbind9.git Remove xfr->end The structure member is populated only moments before its destruction, and is not used anywhere, except for the destructor. Use a local variable instead. --- diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 2560e229b11..d818aca33eb 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -152,7 +152,6 @@ struct dns_xfrin { unsigned int nrecs; /*%< Number of records recvd */ uint64_t nbytes; /*%< Number of bytes received */ isc_time_t start; /*%< Start time of the transfer */ - isc_time_t end; /*%< End time of the transfer */ dns_transport_type_t soa_transport_type; uint32_t end_serial; @@ -1878,6 +1877,7 @@ failure: static void xfrin_destroy(dns_xfrin_t *xfr) { uint64_t msecs, persec; + isc_time_t now = isc_time_now(); REQUIRE(VALID_XFRIN(xfr)); REQUIRE(dns_zone_gettid(xfr->zone) == isc_tid()); @@ -1900,8 +1900,7 @@ xfrin_destroy(dns_xfrin_t *xfr) { * and print a log message with the bytes and rate. */ LOCK(&xfr->statslock); - xfr->end = isc_time_now(); - msecs = isc_time_microdiff(&xfr->end, &xfr->start) / 1000; + msecs = isc_time_microdiff(&now, &xfr->start) / 1000; if (msecs == 0) { msecs = 1; }