diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 33 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 2 |
2 files changed, 31 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 0fdb413263c..4d8f6d524c8 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -288,12 +288,39 @@ NodeI::patch(const string& application, } _patchInProgress.insert(application); - if(server.empty() || !appDistrib.icepatch.empty()) + if(!appDistrib.icepatch.empty()) { + // + // Get all the application servers (even the ones which + // don't have a distribution since they depend on the + // application distribution). + // servers = getApplicationServers(application); } + else if(server.empty()) + { + // + // Get all the application servers which have a distribution. + // + servers = getApplicationServers(application); + set<ServerIPtr>::iterator s = servers.begin(); + while(s != servers.end()) + { + if((*s)->getDistribution().icepatch.empty()) + { + servers.erase(s++); + } + else + { + ++s; + } + } + } else { + // + // Get the given server. + // Ice::Identity id = createServerIdentity(server); ServerIPtr svr = ServerIPtr::dynamicCast(_adapter->find(id)); if(svr) @@ -361,12 +388,12 @@ NodeI::patch(const string& application, // for(s = servers.begin(); s != servers.end(); ++s) { - if(!server.empty() && (*s)->getId() != server) + DistributionDescriptor dist = (*s)->getDistribution(); + if(dist.icepatch.empty() || (!server.empty() && (*s)->getId() != server)) { continue; } - DistributionDescriptor dist = (*s)->getDistribution(); icepatch = FileServerPrx::checkedCast(getCommunicator()->stringToProxy(dist.icepatch)); if(!icepatch) { diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 8cd5ce1bad0..5f085fe85c3 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1164,7 +1164,7 @@ ServerI::terminated() if(_state != ServerI::Destroying) { - setStateNoSync(ServerI::Inactive); + setStateNoSync(ServerI::Inactive, "The server terminated unexpectedly."); command = nextCommand(); } else |