diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-06-08 16:43:28 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-06-08 16:43:28 +0000 |
commit | 0d9a9a82bc754e8ee12c5b7b4c8befd7b5b5c12b (patch) | |
tree | d2c6337515ec0d27c2880c7d642046360d2ddac3 | |
parent | 477ef3c8435165fa70d6a19c195e4b14c4e6073f (diff) | |
download | qpid-python-0d9a9a82bc754e8ee12c5b7b4c8befd7b5b5c12b.tar.gz |
Fix of the previous client heartbeat changes:
- Changes to the cluster code were previously missed
- It's neater and more correct to reset the traffic
timeout for all connection traffic, not just traffic
in a session
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@782696 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 3 | ||||
-rw-r--r-- | cpp/src/qpid/broker/ConnectionHandler.cpp | 3 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h | 1 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/OutputInterceptor.cpp | 5 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/OutputInterceptor.h | 1 |
5 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index c53d943e98..c21fd49171 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -103,6 +103,9 @@ Connection::~Connection() } void Connection::received(framing::AMQFrame& frame) { + // Received frame on connection so delay timeout + restartTimeout(); + if (frame.getChannel() == 0 && frame.getMethod()) { adapter.handle(frame); } else { diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp index d3e795ae06..1d6c4c9ad8 100644 --- a/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -63,9 +63,6 @@ void ConnectionHandler::heartbeat() void ConnectionHandler::handle(framing::AMQFrame& frame) { - // Received frame on connection so delay timeout - handler->connection.restartTimeout(); - AMQMethodBody* method=frame.getBody()->getMethod(); Connection::ErrorListener* errorListener = handler->connection.getErrorListener(); try{ diff --git a/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h b/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h index 6a30bddf06..566a82476e 100644 --- a/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h +++ b/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h @@ -37,6 +37,7 @@ class NoOpConnectionOutputHandler : public sys::ConnectionOutputHandler public: virtual void send(framing::AMQFrame&) {} virtual void close() {} + virtual void abort() {} virtual void activateOutput() {} virtual void giveReadCredit(int32_t) {} }; diff --git a/cpp/src/qpid/cluster/OutputInterceptor.cpp b/cpp/src/qpid/cluster/OutputInterceptor.cpp index f898957351..b5fa595577 100644 --- a/cpp/src/qpid/cluster/OutputInterceptor.cpp +++ b/cpp/src/qpid/cluster/OutputInterceptor.cpp @@ -64,6 +64,11 @@ void OutputInterceptor::activateOutput() { sendDoOutput(sendMax); } +void OutputInterceptor::abort() { + sys::Mutex::ScopedLock l(lock); + next->abort(); +} + void OutputInterceptor::giveReadCredit(int32_t credit) { sys::Mutex::ScopedLock l(lock); next->giveReadCredit(credit); diff --git a/cpp/src/qpid/cluster/OutputInterceptor.h b/cpp/src/qpid/cluster/OutputInterceptor.h index 7d6c718b82..62b7d6567f 100644 --- a/cpp/src/qpid/cluster/OutputInterceptor.h +++ b/cpp/src/qpid/cluster/OutputInterceptor.h @@ -43,6 +43,7 @@ class OutputInterceptor : public sys::ConnectionOutputHandler { // sys::ConnectionOutputHandler functions void send(framing::AMQFrame& f); + void abort(); void activateOutput(); void giveReadCredit(int32_t); void close(); |