diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-08-06 11:39:57 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-08-06 11:51:00 +0200 |
commit | fc34191920a7fe8691d391c20ca8cdba848d6918 (patch) | |
tree | 4818333cd6c9e556cd4c5698f3ae4e21af3b08d1 /cpp/src | |
parent | Added code to use referer to select correct index depending (diff) | |
download | ice-fc34191920a7fe8691d391c20ca8cdba848d6918.tar.bz2 ice-fc34191920a7fe8691d391c20ca8cdba848d6918.tar.xz ice-fc34191920a7fe8691d391c20ca8cdba848d6918.zip |
Fixed bug 2355
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceGrid/ServerAdapterI.cpp | 17 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerAdapterI.h | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/IceGrid/ServerAdapterI.cpp b/cpp/src/IceGrid/ServerAdapterI.cpp index 85023b27a3d..b6835e6d90f 100644 --- a/cpp/src/IceGrid/ServerAdapterI.cpp +++ b/cpp/src/IceGrid/ServerAdapterI.cpp @@ -70,6 +70,7 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur { return; } + _activateAfterDeactivating = _server->getState() >= Deactivating; } // @@ -141,11 +142,20 @@ ServerAdapterI::setDirectProxy(const Ice::ObjectPrx& prx, const Ice::Current&) bool updated = _proxy != prx; _proxy = prx; - for(vector<AMD_Adapter_activatePtr>::const_iterator p = _activateCB.begin(); p != _activateCB.end(); ++p) + // + // If the server is being deactivated and the activation callback + // was added during the deactivation, we don't send the response + // now. The server is going to be activated again and the adapter + // activated. + // + if(_server->getState() < Deactivating || !_activateAfterDeactivating) { - (*p)->ice_response(_proxy); + for(vector<AMD_Adapter_activatePtr>::const_iterator p = _activateCB.begin(); p != _activateCB.end(); ++p) + { + (*p)->ice_response(_proxy); + } + _activateCB.clear(); } - _activateCB.clear(); if(updated) { @@ -186,6 +196,7 @@ ServerAdapterI::clear() { Lock sync(*this); _proxy = 0; + _activateAfterDeactivating = false; } void diff --git a/cpp/src/IceGrid/ServerAdapterI.h b/cpp/src/IceGrid/ServerAdapterI.h index 50bbedd6854..c8cd68e5d0f 100644 --- a/cpp/src/IceGrid/ServerAdapterI.h +++ b/cpp/src/IceGrid/ServerAdapterI.h @@ -48,6 +48,7 @@ private: Ice::ObjectPrx _proxy; std::vector<AMD_Adapter_activatePtr> _activateCB; + bool _activateAfterDeactivating; }; typedef IceUtil::Handle<ServerAdapterI> ServerAdapterIPtr; |