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}) 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 diff --git a/include/amqpcpp/channelimpl.h b/include/amqpcpp/channelimpl.h index 39bea70..71a08a3 100644 --- a/include/amqpcpp/channelimpl.h +++ b/include/amqpcpp/channelimpl.h @@ -624,7 +624,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/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; } 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;