diff options
-rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Connection.cpp | 1 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp index be2e335c4d..e4fce784f1 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp @@ -234,6 +234,7 @@ size_t Connection::encode(char* buffer, size_t size) if (n > 0) { QPID_LOG_CAT(debug, network, id << " encoded " << n << " bytes from " << size) haveOutput = true; + if (ticker) ticker->restart(); return n; } else if (n == PN_EOS) { haveOutput = false; diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index 63081c8be2..c519c05d71 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -852,6 +852,7 @@ std::size_t ConnectionContext::encodePlain(char* buffer, std::size_t size) QPID_LOG_CAT(debug, network, id << " encoded " << n << " bytes from " << size) haveOutput = true; if (notifyOnWrite) lock.notifyAll(); + if (ticker) ticker->restart(); return n; } else if (n == PN_ERR) { std::string error; @@ -877,7 +878,7 @@ bool ConnectionContext::canEncodePlain() { sys::Monitor::ScopedLock l(lock); pn_transport_tick(engine, qpid::sys::Duration::FromEpoch() / qpid::sys::TIME_MSEC); - return haveOutput && state == CONNECTED; + return (haveOutput || pn_transport_pending(engine)) && state == CONNECTED; } void ConnectionContext::closed() { |