summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/all.dsw45
-rw-r--r--cpp/src/Glacier2/RouterI.cpp2
-rw-r--r--cpp/src/Glacier2/RoutingTable.cpp31
-rw-r--r--cpp/src/Glacier2/RoutingTable.h2
4 files changed, 69 insertions, 11 deletions
diff --git a/cpp/all.dsw b/cpp/all.dsw
index efbeddcc5ce..36f28aab50d 100644
--- a/cpp/all.dsw
+++ b/cpp/all.dsw
@@ -3147,6 +3147,51 @@ Package=<4>
###############################################################################
+Project: "regexC"=.\test\Glacier2\regex\regexC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glacier2
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ice
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name iceutil
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name slice2cpp
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "regexS"=.\test\Glacier2\regex\regexS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name ice
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name iceutil
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name slice2cpp
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "retryC"=.\test\Ice\retry\retryC.dsp - Package Owner=<4>
Package=<5>
diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp
index aade55cc31d..4e1b7a51744 100644
--- a/cpp/src/Glacier2/RouterI.cpp
+++ b/cpp/src/Glacier2/RouterI.cpp
@@ -142,7 +142,7 @@ Glacier2::RouterI::addProxies(const ObjectProxySeq& proxies, const Current& curr
_timestamp = IceUtil::Time::now();
- return _routingTable->add(proxies);
+ return _routingTable->add(proxies, current);
}
string
diff --git a/cpp/src/Glacier2/RoutingTable.cpp b/cpp/src/Glacier2/RoutingTable.cpp
index 22d5b4d4d1b..485e03cc17f 100644
--- a/cpp/src/Glacier2/RoutingTable.cpp
+++ b/cpp/src/Glacier2/RoutingTable.cpp
@@ -22,28 +22,41 @@ Glacier2::RoutingTable::RoutingTable(const CommunicatorPtr& communicator) :
}
ObjectProxySeq
-Glacier2::RoutingTable::add(const ObjectProxySeq& proxies)
+Glacier2::RoutingTable::add(const ObjectProxySeq& proxies, const Ice::Current& current)
{
IceUtil::Mutex::Lock sync(*this);
-
- ObjectProxySeq evictedProxies;
+
+ ObjectProxySeq::const_iterator prx;
- for(ObjectProxySeq::const_iterator prx = proxies.begin(); prx != proxies.end(); ++prx)
+ //
+ // 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)
{
if(!*prx) // We ignore null proxies.
{
continue;
}
- ObjectPrx proxy = (*prx)->ice_twoway()->ice_secure(false); // We add proxies in default form.
+ if(!_verifier.verify(*prx))
+ {
+ current.con->close(true);
+ throw ObjectNotExistException(__FILE__, __LINE__);
+ }
+ }
- if(!_verifier.verify(proxy))
+ ObjectProxySeq evictedProxies;
+ for(prx = proxies.begin(); prx != proxies.end(); ++prx)
+ {
+ if(!*prx) // We ignore null proxies.
{
- //
- // XXX - handle rejection here!
- //
+ continue;
}
+ ObjectPrx proxy = (*prx)->ice_twoway()->ice_secure(false); // We add proxies in default form.
+
EvictorMap::iterator p = _map.find(proxy->ice_getIdentity());
if(p == _map.end())
diff --git a/cpp/src/Glacier2/RoutingTable.h b/cpp/src/Glacier2/RoutingTable.h
index 6e9ec844d86..816ae360f61 100644
--- a/cpp/src/Glacier2/RoutingTable.h
+++ b/cpp/src/Glacier2/RoutingTable.h
@@ -27,7 +27,7 @@ public:
RoutingTable(const Ice::CommunicatorPtr&);
- Ice::ObjectProxySeq add(const Ice::ObjectProxySeq&); // Returns evicted proxies.
+ Ice::ObjectProxySeq add(const Ice::ObjectProxySeq&, const Ice::Current&); // Returns evicted proxies.
Ice::ObjectPrx get(const Ice::Identity&); // Returns null if no proxy can be found.
private: