diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/slice/Ice/LocalException.ice | 18 | ||||
-rw-r--r-- | cpp/src/Glacier2/RouterI.cpp | 21 | ||||
-rw-r--r-- | cpp/src/Glacier2/SessionRouterI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.h | 2 |
5 files changed, 35 insertions, 24 deletions
diff --git a/cpp/slice/Ice/LocalException.ice b/cpp/slice/Ice/LocalException.ice index d30a13bfbb4..4a4a3c13f65 100644 --- a/cpp/slice/Ice/LocalException.ice +++ b/cpp/slice/Ice/LocalException.ice @@ -395,12 +395,6 @@ local exception ConnectionTimeoutException extends TimeoutException **/ local exception ProtocolException { - /** - * - * The reason for the failure. - * - **/ -// string reason; }; /** @@ -609,6 +603,12 @@ local exception CompressionNotSupportedException extends ProtocolException **/ local exception CompressionException extends ProtocolException { + /** + * + * The reason for the failure. + * + **/ + string reason; }; /** @@ -630,6 +630,12 @@ local exception DatagramLimitException extends ProtocolException **/ local exception MarshalException extends ProtocolException { + /** + * + * The reason for the failure. + * + **/ + string reason; }; /** diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp index 53d63969a03..1ac8510e9a8 100644 --- a/cpp/src/Glacier2/RouterI.cpp +++ b/cpp/src/Glacier2/RouterI.cpp @@ -41,7 +41,7 @@ Glacier2::RouterI::RouterI(const ObjectAdapterPtr& clientAdapter, const ObjectAd serverProxy = serverAdapter->createProxy(ident); ServerBlobjectPtr& serverBlobject = const_cast<ServerBlobjectPtr&>(_serverBlobject); - serverBlobject = new ServerBlobject(_communicator, connection); + serverBlobject = new ServerBlobject(_communicator, _connection); } } @@ -60,6 +60,8 @@ Glacier2::RouterI::destroy() assert(!_destroy); _destroy = true; + _connection->close(true); + _clientBlobject->destroy(); if(_serverBlobject) @@ -92,14 +94,11 @@ Glacier2::RouterI::getServerProxy(const Current&) const } void -Glacier2::RouterI::addProxy(const ObjectPrx& proxy, const Current&) +Glacier2::RouterI::addProxy(const ObjectPrx& proxy, const Current& current) { IceUtil::Mutex::Lock lock(*this); - if(_destroy) - { - throw ObjectNotExistException(__FILE__, __LINE__); - } + assert(!_destroy); if(_routingTableTraceLevel) { @@ -130,10 +129,7 @@ Glacier2::RouterI::getClientBlobject() const { IceUtil::Mutex::Lock lock(*this); - if(_destroy) - { - throw ObjectNotExistException(__FILE__, __LINE__); - } + assert(!_destroy); _timestamp = IceUtil::Time::now(); @@ -145,10 +141,7 @@ Glacier2::RouterI::getServerBlobject() const { IceUtil::Mutex::Lock lock(*this); - if(_destroy) - { - throw ObjectNotExistException(__FILE__, __LINE__); - } + assert(!_destroy); // // We do not update the timestamp for callbacks from the diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp index 5e344c94510..7b626abb3a5 100644 --- a/cpp/src/Glacier2/SessionRouterI.cpp +++ b/cpp/src/Glacier2/SessionRouterI.cpp @@ -214,6 +214,7 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st if(_destroy) { + current.con->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } @@ -251,6 +252,7 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st if(_destroy) { + current.con->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } @@ -405,6 +407,7 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st // Ignore all exceptions here. } + current.con->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } @@ -440,6 +443,7 @@ Glacier2::SessionRouterI::destroySession(const Current& current) if(_destroy) { + current.con->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } @@ -506,6 +510,7 @@ Glacier2::SessionRouterI::getRouter(const ConnectionPtr& connection) const if(_destroy) { + connection->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } @@ -525,6 +530,7 @@ Glacier2::SessionRouterI::getRouter(const ConnectionPtr& connection) const } else { + connection->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } } diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index eefd1265b90..492bb72c398 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -209,9 +209,14 @@ void Ice::ConnectionI::close(bool force) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - - + if(force) + { + setState(StateClosed, ForcedCloseConnectionException(__FILE__, __LINE__)); + } + else + { + setState(StateClosing, CloseConnectionException(__FILE__, __LINE__)); + } } bool @@ -1479,6 +1484,7 @@ Ice::ConnectionI::setState(State state, const LocalException& ex) // Don't warn about certain expected exceptions. // if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) || + dynamic_cast<const ForcedCloseConnectionException*>(_exception.get()) || dynamic_cast<const ConnectionTimeoutException*>(_exception.get()) || dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) || dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) || diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h index 2ce8b0aa837..9af069f7748 100644 --- a/cpp/src/Ice/Reference.h +++ b/cpp/src/Ice/Reference.h @@ -186,8 +186,8 @@ protected: private: // TODO: Add leading underscore for private members. - bool collocationOptimization; RouterInfoPtr routerInfo; // Null if no router is used. + bool collocationOptimization; }; class DirectReference : public RoutableReference |