1
0
Fork 0

Bug fix 3.5/fix uninitialized value (#9515)

* fix uninitialized time point value, which led to potential bogus error
messages

* fix typo in info message
This commit is contained in:
Jan 2019-07-18 22:26:51 +02:00 committed by KVS85
parent 9781b9890c
commit 47d7f9e3e2
2 changed files with 4 additions and 5 deletions

View File

@ -246,9 +246,9 @@ void SocketTask::resetKeepAlive() {
std::weak_ptr<SocketTask> self = shared_from_this();
_keepAliveTimer->async_wait([self](const asio_ns::error_code& ec) {
if (!ec) { // error will be true if timer was canceled
LOG_TOPIC("f0948", INFO, Logger::COMMUNICATION)
<< "keep alive timout - closing stream!";
if (auto s = self.lock()) {
LOG_TOPIC("f0948", INFO, Logger::COMMUNICATION)
<< "keep alive timeout - closing stream!";
s->closeStream();
}
}

View File

@ -71,7 +71,7 @@ namespace {
thread_local time_point conditionQueueFullSince{};
thread_local uint_fast32_t queueWarningTick{};
time_point lastWarningQueue;
time_point lastWarningQueue = std::chrono::steady_clock::now();
int64_t queueWarningEvents = 0;
std::mutex queueWarningMutex;
@ -79,9 +79,8 @@ namespace {
int64_t fullQueueEvents[3] = {0, 0, 0};
std::mutex fullQueueWarningMutex[3];
void logQueueWarningEveryNowAndThen(int64_t events) {
auto const& now = std::chrono::steady_clock::now();
auto const now = std::chrono::steady_clock::now();
uint64_t totalEvents;
bool printLog = false;
std::chrono::duration<double> sinceLast;