diff options
Diffstat (limited to 'qpid/cpp/src/qpid/cluster/Connection.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/cluster/Connection.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp index 3f331978ca..d97a1b6c68 100644 --- a/qpid/cpp/src/qpid/cluster/Connection.cpp +++ b/qpid/cpp/src/qpid/cluster/Connection.cpp @@ -77,11 +77,15 @@ void Connection::init() { QPID_LOG(debug, cluster << " new connection: " << *this); if (isLocalClient()) { cluster.addLocalConnection(this); - if (cluster.getReadMax()) - output.giveReadCredit(cluster.getReadMax()); + giveReadCredit(cluster.getReadMax()); } } +void Connection::giveReadCredit(int credit) { + if (cluster.getReadMax() && credit) + output.giveReadCredit(credit); +} + Connection::~Connection() { QPID_LOG(debug, cluster << " deleted connection: " << *this); } @@ -141,8 +145,7 @@ void Connection::deliveredFrame(const EventFrame& f) { { connection.received(const_cast<AMQFrame&>(f.frame)); // Pass to broker connection. } - if (cluster.getReadMax() && f.readCredit) - output.giveReadCredit(f.readCredit); + giveReadCredit(f.readCredit); } // A local connection is closed by the network layer. |