Files
infix/package/rousette/0019-ping-use-a-monotonic-timer.patch
Joachim Wiberg 4dee5e4f1f package/rousette: silence rousette warnings in log
Add --log-level command line option to filter out log messages from
lower log levels.  Then fix the annoying CzechLight warning message
and useless "NACM config validation" log.  Then add audit trail as
we have in netopeer2-server, and finish off by stripping redundant
fields from log message: timestamp, identity, and log level.

Fixes #892

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-03-20 16:18:16 +01:00

63 lines
2.0 KiB
Diff

From f71d4467409885078395c8d59c4390ddc1782d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Mon, 6 Oct 2025 22:35:27 +0200
Subject: [PATCH 19/42] ping: use a monotonic timer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Wires
The deadline_timer uses system's UTC clock which is not monotonic (i.e.,
it jumps when the wall clock is adjusted). Let's switch to a monotonic
timer.
Given that boost::asio::steady_timer::expires_from_now() is marked as
deprecated, use the other function.
Change-Id: I40383721ecb0f12bfcb3f638124a32150a29bf48
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 2 +-
src/http/EventStream.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/http/EventStream.cpp b/src/http/EventStream.cpp
index f97d953..280addd 100644
--- a/src/http/EventStream.cpp
+++ b/src/http/EventStream.cpp
@@ -180,7 +180,7 @@ void EventStream::enqueue(const std::string& fieldName, const std::string& what)
void EventStream::start_ping()
{
- ping.expires_from_now(boost::posix_time::seconds(m_keepAlivePingInterval.count()));
+ ping.expires_after(m_keepAlivePingInterval);
ping.async_wait([weak = weak_from_this()](const boost::system::error_code& ec) {
auto myself = weak.lock();
if (!myself) {
diff --git a/src/http/EventStream.h b/src/http/EventStream.h
index 87d8c82..f9f0dd6 100644
--- a/src/http/EventStream.h
+++ b/src/http/EventStream.h
@@ -7,7 +7,7 @@
#pragma once
-#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/steady_timer.hpp>
#include <boost/signals2.hpp>
#include <list>
#include <memory>
@@ -50,7 +50,7 @@ private:
};
State state = WaitingForEvents;
- boost::asio::deadline_timer ping;
+ boost::asio::steady_timer ping;
std::list<std::string> queue;
mutable std::mutex mtx; // for `state` and `queue`
boost::signals2::scoped_connection eventSub, terminateSub;
--
2.43.0