diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-05-18 11:44:59 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-05-18 11:44:59 +0200 |
commit | c6e56f3d6abcf89770064f367110066d5dfd68bf (patch) | |
tree | 3d406b78061a5e610b1947ac82ed7184790b2e6d /cpp/src/IceBridge/IceBridge.cpp | |
parent | ICE-7442 - reorganizing Python installation (diff) | |
download | ice-c6e56f3d6abcf89770064f367110066d5dfd68bf.tar.bz2 ice-c6e56f3d6abcf89770064f367110066d5dfd68bf.tar.xz ice-c6e56f3d6abcf89770064f367110066d5dfd68bf.zip |
Fixed ICE-7885 - IceBridge/simple test failure, debugging info for ICE-7886
Diffstat (limited to 'cpp/src/IceBridge/IceBridge.cpp')
-rw-r--r-- | cpp/src/IceBridge/IceBridge.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/cpp/src/IceBridge/IceBridge.cpp b/cpp/src/IceBridge/IceBridge.cpp index 3e96507d0ea..f90a13434ac 100644 --- a/cpp/src/IceBridge/IceBridge.cpp +++ b/cpp/src/IceBridge/IceBridge.cpp @@ -372,6 +372,48 @@ BridgeConnection::outgoingException(const Exception& ex) } void +BridgeConnection::closed(const ConnectionPtr& con) +{ + IceUtil::Mutex::Lock lock(_lock); + if(_exception) + { + return; // Nothing to do if the exception is already set, both connections have been closed already. + } + + ConnectionPtr toBeClosed = con == _incoming ? _outgoing : _incoming; + try + { + con->throwException(); + } + catch(const Ice::CloseConnectionException& ex) + { + _exception.reset(ex.ice_clone()); + if(toBeClosed) + { + toBeClosed->close(ICE_SCOPED_ENUM(ConnectionClose, Gracefully)); + } + } + catch(const Ice::Exception& ex) + { + _exception.reset(ex.ice_clone()); + if(toBeClosed) + { + toBeClosed->close(ICE_SCOPED_ENUM(ConnectionClose, Forcefully)); + } + } + + // + // Even though the connection is already closed, we still need to "complete" the pending invocations so + // that the connection's dispatch count is updated correctly. + // + for(vector<QueuedInvocationPtr>::iterator p = _queue.begin(); p != _queue.end(); ++p) + { + (*p)->cb->ice_exception(*_exception.get()); + } + _queue.clear(); +} + +void BridgeConnection::dispatch(const AMD_Object_ice_invokePtr& cb, const pair<const Byte*, const Byte*>& paramData, const Current& current) { @@ -538,48 +580,6 @@ BridgeI::closed(const ConnectionPtr& con) } void -BridgeConnection::closed(const ConnectionPtr& con) -{ - IceUtil::Mutex::Lock lock(_lock); - if(_exception) - { - return; // Nothing to do if the exception is already set, both connections have been closed already. - } - - ConnectionPtr toBeClosed = con == _incoming ? _outgoing : _incoming; - try - { - con->throwException(); - } - catch(const Ice::CloseConnectionException& ex) - { - _exception.reset(ex.ice_clone()); - if(toBeClosed) - { - toBeClosed->close(ICE_SCOPED_ENUM(ConnectionClose, Gracefully)); - } - } - catch(const Ice::Exception& ex) - { - _exception.reset(ex.ice_clone()); - if(toBeClosed) - { - toBeClosed->close(ICE_SCOPED_ENUM(ConnectionClose, Forcefully)); - } - } - - // - // Even though the connection is already closed, we still need to "complete" the pending invocations so - // that the connection's dispatch count is updated correctly. - // - for(vector<QueuedInvocationPtr>::iterator p = _queue.begin(); p != _queue.end(); ++p) - { - (*p)->cb->ice_exception(*_exception.get()); - } - _queue.clear(); -} - -void BridgeI::outgoingSuccess(const BridgeConnectionPtr& bc, const ConnectionPtr& outgoing) { // |