summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectRequestHandler.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-10-24 11:08:15 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-10-24 11:08:15 +0200
commit245b8e2fc092864a7a4be372fb96c09a7853be83 (patch)
treedc3f7d726ff4203d1950f0935e23cd7fdf691724 /cpp/src/Ice/ConnectRequestHandler.cpp
parentFixed Java StreamSocket finalizer bug (diff)
downloadice-245b8e2fc092864a7a4be372fb96c09a7853be83.tar.bz2
ice-245b8e2fc092864a7a4be372fb96c09a7853be83.tar.xz
ice-245b8e2fc092864a7a4be372fb96c09a7853be83.zip
Fixed ICE-5775: interrupt test failure
Diffstat (limited to 'cpp/src/Ice/ConnectRequestHandler.cpp')
-rw-r--r--cpp/src/Ice/ConnectRequestHandler.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp
index 55f1c508d5a..9395696563a 100644
--- a/cpp/src/Ice/ConnectRequestHandler.cpp
+++ b/cpp/src/Ice/ConnectRequestHandler.cpp
@@ -25,6 +25,7 @@ using namespace IceInternal;
ConnectRequestHandler::ConnectRequestHandler(const ReferencePtr& ref, const Ice::ObjectPrx& proxy) :
RequestHandler(ref),
+ _connect(true),
_proxy(proxy),
_batchAutoFlush(
ref->getInstance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0),
@@ -47,8 +48,9 @@ ConnectRequestHandler::connect(const Ice::ObjectPrx& proxy)
// Initiate the connection if connect() is called by the proxy that
// created the handler.
//
- if(proxy.get() == _proxy.get())
+ if(proxy.get() == _proxy.get() && _connect)
{
+ _connect = false; // Call getConnection only once
_reference->getConnection(this);
}
@@ -57,7 +59,7 @@ ConnectRequestHandler::connect(const Ice::ObjectPrx& proxy)
Lock sync(*this);
if(!initialized())
{
- _proxies.push_back(proxy);
+ _proxies.insert(proxy);
return this;
}
}
@@ -489,7 +491,7 @@ ConnectRequestHandler::flushRequests()
if(_reference->getCacheConnection() && !_exception.get())
{
_connectionRequestHandler = new ConnectionRequestHandler(_reference, _connection, _compress);
- for(vector<Ice::ObjectPrx>::const_iterator p = _proxies.begin(); p != _proxies.end(); ++p)
+ for(set<Ice::ObjectPrx>::const_iterator p = _proxies.begin(); p != _proxies.end(); ++p)
{
(*p)->__setRequestHandler(this, _connectionRequestHandler);
}