From 549fec5cb1ecc30c3d8a65c7610a89fba537923c Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 12 Nov 2018 22:07:48 +0100 Subject: [PATCH 1/4] libevhandler only checks for heartbeats if not overridden by user --- include/amqpcpp/libev.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/amqpcpp/libev.h b/include/amqpcpp/libev.h index 7a13127..416f5cd 100644 --- a/include/amqpcpp/libev.h +++ b/include/amqpcpp/libev.h @@ -189,6 +189,12 @@ private: */ ev_tstamp _expire; + /** + * Are heartbeats enabled? + * @var bool + */ + bool _enabled = false; + /** * Interval between heartbeats * @var uint16_t @@ -216,6 +222,9 @@ private: */ virtual void onExpired() override { + // do nothing if heartbeats are not enabled + if (!_enabled) return; + // get the current time ev_tstamp now = ev_now(_loop); @@ -313,6 +322,9 @@ private: */ uint16_t start() { + // remember that heartbeats are enabled + _enabled = true; + // expose the interval (the timer is already running, so we do not have to explicitly start it) return _interval; } From 1dd04760a92ee02e99e778434ad370fcdb47bd4a Mon Sep 17 00:00:00 2001 From: Rafal Goslawski Date: Thu, 15 Nov 2018 11:48:34 +0100 Subject: [PATCH 2/4] Bump version to 4.0.0 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a5a9ca6..0ea9e6e 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ PREFIX ?= /usr INCLUDE_DIR = ${PREFIX}/include LIBRARY_DIR = ${PREFIX}/lib export LIBRARY_NAME = amqpcpp -export SONAME = 3.2 -export VERSION = 3.2.0 +export SONAME = 4.0 +export VERSION = 4.0.0 all: $(MAKE) -C src all From bddceb77f2cd5a1ae137928e8553915612920fab Mon Sep 17 00:00:00 2001 From: Rafal Goslawski Date: Thu, 15 Nov 2018 11:48:53 +0100 Subject: [PATCH 3/4] Bump version to 4.0.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b632d5f..ff729d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.2 FATAL_ERROR) # project name project(amqpcpp) -set (VERSION_MAJOR 3) -set (VERSION_MINOR 2) +set (VERSION_MAJOR 4) +set (VERSION_MINOR 0) set (VERSION_PATCH 0) set (SO_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) From 8eed7099883eaa30bfa9310437c4de7a51941ff7 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Wed, 21 Nov 2018 13:56:44 +0100 Subject: [PATCH 4/4] Connection::fail() will now also call the channel::onError method --- include/amqpcpp/channelimpl.h | 2 +- src/connectionimpl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/amqpcpp/channelimpl.h b/include/amqpcpp/channelimpl.h index 0385af3..02e4d1b 100644 --- a/include/amqpcpp/channelimpl.h +++ b/include/amqpcpp/channelimpl.h @@ -623,7 +623,7 @@ public: // all later deferred objects should report an error, because it // was not possible to complete the instruction as the channel is - // now closed + // now closed (but the channel onError does not have to run) reportError("Channel has been closed", false); // done diff --git a/src/connectionimpl.cpp b/src/connectionimpl.cpp index 7b91dcd..bc06c4d 100644 --- a/src/connectionimpl.cpp +++ b/src/connectionimpl.cpp @@ -192,7 +192,7 @@ bool ConnectionImpl::fail(const Monitor &monitor, const char *message) while (!_channels.empty()) { // report the errors - _channels.begin()->second->reportError(message, false); + _channels.begin()->second->reportError(message); // leap out if no longer valid if (!monitor.valid()) return false;