close(newfd);
return 0;
}
- uint64_t count = 0;
+ uint64_t theCount = 0;
fprintf(filePtr.get(), "; cookie dump follows\n; server\tlocal\tcookie\tsupport\tts\n");
for (const auto& entry : *this) {
- count++;
+ theCount++;
timebuf_t tmp;
fprintf(filePtr.get(), "%s\t%s\t%s\t%s\t%s\n",
entry.d_address.toStringWithPortExcept(53).c_str(), entry.d_localaddress.toString().c_str(),
CookieEntry::toString(entry.d_support).c_str(),
entry.d_lastused == std::numeric_limits<time_t>::max() ? "Forever" : timestamp(entry.d_lastused, tmp));
}
- return count;
+ return theCount;
}
full.add_int64(PBNSSpeedDump::required_int64_time, time(nullptr));
full.add_string(PBNSSpeedDump::required_string_type, "PBNSSpeedDump");
- size_t count = 0;
+ size_t theCount = 0;
ret.reserve(estimate);
for (const auto& entry : *this) {
getPBEntry(message, entry);
if (maxSize > 0 && ret.size() > maxSize) {
message.rollback();
- log->info(Logr::Info, "Produced nsspeed dump (max size reached)", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(count));
- return count;
+ log->info(Logr::Info, "Produced nsspeed dump (max size reached)", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(theCount));
+ return theCount;
}
- ++count;
+ ++theCount;
}
- log->info(Logr::Info, "Produced nsspeed dump", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(count));
- return count;
+ log->info(Logr::Info, "Produced nsspeed dump", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(theCount));
+ return theCount;
}
template <typename T>