From 4900e45ceadf8b1acd435a6e7b9423e5fa09ebc9 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 24 Nov 2014 18:22:03 +0100 Subject: Fixed ICE-5969: IceGrid/allocation test failure --- cpp/src/Ice/ConnectionI.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'cpp/src/Ice/ConnectionI.cpp') diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index ae7f9d37c36..ddcbea13f11 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -552,17 +552,6 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } assert(acm.timeout != IceUtil::Time()); - if(static_cast(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) - { - // - // If writing or reading, nothing to do, the connection - // timeout will kick-in if writes or reads don't progress. - // This check is necessary because the actitivy timer is - // only set when a message is fully read/written. - // - return; - } - // // We send a heartbeat if there was no activity in the last // (timeout / 4) period. Sending a heartbeat sooner than really @@ -575,9 +564,8 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) // per timeout period because the monitor() method is sill only // called every (timeout / 2) period. // - if(acm.heartbeat == HeartbeatAlways || - (acm.heartbeat != HeartbeatOff && now >= (_acmLastActivity + acm.timeout / 4))) + (acm.heartbeat != HeartbeatOff && _writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4))) { if(acm.heartbeat != HeartbeatOnInvocation || _dispatchCount > 0) { @@ -585,6 +573,17 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } } + if(static_cast(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) + { + // + // If writing or reading, nothing to do, the connection + // timeout will kick-in if writes or reads don't progress. + // This check is necessary because the actitivy timer is + // only set when a message is fully read/written. + // + return; + } + if(acm.close != CloseOff && now >= (_acmLastActivity + acm.timeout)) { if(acm.close == CloseOnIdleForceful || -- cgit v1.2.3