From cfb5cb89d3b849e5b622c99d9a6e2ee9e64fa63f Mon Sep 17 00:00:00 2001 From: Tao He Date: Mon, 11 Jan 2021 20:47:11 +0800 Subject: [PATCH] Fixes the -Werror for unused "continue_next": we just use it. Signed-off-by: Tao He --- src/KeepAlive.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/KeepAlive.cpp b/src/KeepAlive.cpp index 18541a5..f15701a 100644 --- a/src/KeepAlive.cpp +++ b/src/KeepAlive.cpp @@ -36,6 +36,10 @@ etcd::KeepAlive::~KeepAlive() void etcd::KeepAlive::Cancel() { + if (!continue_next) { + return; + } + continue_next = false; #ifndef NDEBUG { std::ios::fmtflags os_flags (std::cout.flags()); @@ -52,6 +56,9 @@ void etcd::KeepAlive::Cancel() void etcd::KeepAlive::refresh() { + if (!continue_next) { + return; + } // minimal resolution: 1 second int keepalive_ttl = std::max(ttl - 1, 1); #ifndef NDEBUG