diff options
author | Brent Eagles <brent@zeroc.com> | 2006-04-18 14:38:48 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2006-04-18 14:38:48 +0000 |
commit | bbdb2674c0b931d2b8a5b32cdc57c09eb59bf4a2 (patch) | |
tree | 31e12644e55d89afe167dd8add4156d15a148f2a /cpp/src | |
parent | adding regex to full test run (diff) | |
download | ice-bbdb2674c0b931d2b8a5b32cdc57c09eb59bf4a2.tar.bz2 ice-bbdb2674c0b931d2b8a5b32cdc57c09eb59bf4a2.tar.xz ice-bbdb2674c0b931d2b8a5b32cdc57c09eb59bf4a2.zip |
refactor addProxy method a bit
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Glacier2/RoutingTable.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cpp/src/Glacier2/RoutingTable.cpp b/cpp/src/Glacier2/RoutingTable.cpp index 485e03cc17f..e40d4aeaf2a 100644 --- a/cpp/src/Glacier2/RoutingTable.cpp +++ b/cpp/src/Glacier2/RoutingTable.cpp @@ -22,18 +22,20 @@ Glacier2::RoutingTable::RoutingTable(const CommunicatorPtr& communicator) : } ObjectProxySeq -Glacier2::RoutingTable::add(const ObjectProxySeq& proxies, const Ice::Current& current) +Glacier2::RoutingTable::add(const ObjectProxySeq& unfiltered, const Ice::Current& current) { IceUtil::Mutex::Lock sync(*this); ObjectProxySeq::const_iterator prx; + ObjectProxySeq proxies; + // // We 'pre-scan' the list, applying our validation rules. The // ensures that our state is not modified if this operation results // in a rejection. // - for(prx = proxies.begin(); prx != proxies.end(); ++prx) + for(prx = unfiltered.begin(); prx != unfiltered.end(); ++prx) { if(!*prx) // We ignore null proxies. { @@ -45,18 +47,14 @@ Glacier2::RoutingTable::add(const ObjectProxySeq& proxies, const Ice::Current& c current.con->close(true); throw ObjectNotExistException(__FILE__, __LINE__); } + ObjectPrx proxy = (*prx)->ice_twoway()->ice_secure(false); // We add proxies in default form. + proxies.push_back(proxy); } ObjectProxySeq evictedProxies; for(prx = proxies.begin(); prx != proxies.end(); ++prx) { - if(!*prx) // We ignore null proxies. - { - continue; - } - - ObjectPrx proxy = (*prx)->ice_twoway()->ice_secure(false); // We add proxies in default form. - + ObjectPrx proxy = *prx; EvictorMap::iterator p = _map.find(proxy->ice_getIdentity()); if(p == _map.end()) |