diff options
author | Marc Laukien <marc@zeroc.com> | 2004-04-18 14:45:21 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-04-18 14:45:21 +0000 |
commit | f1f9d4683dc42533ea66c14e59a96e8fc0c7b651 (patch) | |
tree | e94c0e1c8b7c7a24f5dc318f0523ea501afa7205 /cpp/src/Ice/Connection.cpp | |
parent | assertions are now correctly caught (diff) | |
download | ice-f1f9d4683dc42533ea66c14e59a96e8fc0c7b651.tar.bz2 ice-f1f9d4683dc42533ea66c14e59a96e8fc0c7b651.tar.xz ice-f1f9d4683dc42533ea66c14e59a96e8fc0c7b651.zip |
fixes
Diffstat (limited to 'cpp/src/Ice/Connection.cpp')
-rw-r--r-- | cpp/src/Ice/Connection.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index 4630e41787c..bb187af20fb 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -1303,7 +1303,7 @@ IceInternal::Connection::message(BasicStream& stream, const ThreadPoolPtr& threa // try { - while(invoke-- > 0) + while(invoke > 0) { // // Prepare the invocation. @@ -1319,7 +1319,7 @@ IceInternal::Connection::message(BasicStream& stream, const ThreadPoolPtr& threa // if(response) { - assert(invoke == 0); // No further invocations if a response is expected. + assert(invoke == 1); // No further invocations if a response is expected. os->writeBlob(_replyHdr); // @@ -1333,7 +1333,7 @@ IceInternal::Connection::message(BasicStream& stream, const ThreadPoolPtr& threa // // If there are more invocations, we need the stream back. // - if(invoke > 0) + if(--invoke > 0) { stream.swap(*is); } @@ -1343,6 +1343,20 @@ IceInternal::Connection::message(BasicStream& stream, const ThreadPoolPtr& threa { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); setState(StateClosed, ex); + + // + // If invoke() above raised an exception, and therefore + // neither sendResponse() nor sendNoResponse() has been + // called, then we must decrement _dispatchCount here. + // + assert(invoke > 0); + assert(_dispatchCount > 0); + _dispatchCount -= invoke; + assert(_dispatchCount >= 0); + if(_dispatchCount == 0) + { + notifyAll(); + } } } |