summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectRequestHandler.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-07-15 10:22:40 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-07-15 10:22:40 +0200
commit710a9221852d6c92b1727a429a33b38f1f949352 (patch)
tree6bc9ac9ed04a6b1858d8fc30282d4f18ef04abbb /cpp/src/Ice/ConnectRequestHandler.cpp
parent- Fix for ICE-5578 - Python build failure (diff)
downloadice-710a9221852d6c92b1727a429a33b38f1f949352.tar.bz2
ice-710a9221852d6c92b1727a429a33b38f1f949352.tar.xz
ice-710a9221852d6c92b1727a429a33b38f1f949352.zip
Fixed collocation optimization to use the dispatcher, minor test fixes
Diffstat (limited to 'cpp/src/Ice/ConnectRequestHandler.cpp')
-rw-r--r--cpp/src/Ice/ConnectRequestHandler.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp
index c3b4a4b160d..fdb631440ca 100644
--- a/cpp/src/Ice/ConnectRequestHandler.cpp
+++ b/cpp/src/Ice/ConnectRequestHandler.cpp
@@ -248,7 +248,7 @@ ConnectRequestHandler::requestTimedOut(OutgoingMessageCallback* out)
if(p->out == out)
{
Ice::InvocationTimeoutException ex(__FILE__, __LINE__);
- out->finished(ex, false);
+ out->finished(ex);
_requests.erase(p);
return;
}
@@ -262,7 +262,6 @@ ConnectRequestHandler::requestTimedOut(OutgoingMessageCallback* out)
void
ConnectRequestHandler::asyncRequestTimedOut(const OutgoingAsyncMessageCallbackPtr& outAsync)
{
- bool timedOut = false;
{
Lock sync(*this);
if(_exception.get())
@@ -276,19 +275,14 @@ ConnectRequestHandler::asyncRequestTimedOut(const OutgoingAsyncMessageCallbackPt
{
if(p->outAsync.get() == outAsync.get())
{
- timedOut = true;
_requests.erase(p);
- break;
+ outAsync->__dispatchInvocationTimeout(_reference->getInstance()->clientThreadPool(), 0);
+ return;
}
}
+ assert(false); // The request has to be queued if it timed out and we're not initialized yet.
}
}
- if(timedOut)
- {
- Ice::InvocationTimeoutException ex(__FILE__, __LINE__);
- outAsync->__finished(ex, false);
- return;
- }
_connection->asyncRequestTimedOut(outAsync);
}
@@ -369,7 +363,7 @@ ConnectRequestHandler::setException(const Ice::LocalException& ex)
//
if(!_requests.empty())
{
- _reference->getInstance()->clientThreadPool()->execute(new FlushRequestsWithException(_connection, this));
+ _reference->getInstance()->clientThreadPool()->dispatch(new FlushRequestsWithException(_connection, this));
}
notifyAll();
@@ -485,19 +479,19 @@ ConnectRequestHandler::flushRequests()
Lock sync(*this);
assert(!_exception.get() && !_requests.empty());
_exception.reset(ex.get()->ice_clone());
- _reference->getInstance()->clientThreadPool()->execute(new FlushRequestsWithException(_connection, this));
+ _reference->getInstance()->clientThreadPool()->dispatch(new FlushRequestsWithException(_connection, this));
}
catch(const Ice::LocalException& ex)
{
Lock sync(*this);
assert(!_exception.get() && !_requests.empty());
_exception.reset(ex.ice_clone());
- _reference->getInstance()->clientThreadPool()->execute(new FlushRequestsWithException(_connection, this));
+ _reference->getInstance()->clientThreadPool()->dispatch(new FlushRequestsWithException(_connection, this));
}
if(!sentCallbacks.empty())
{
- _reference->getInstance()->clientThreadPool()->execute(new FlushSentRequests(_connection, sentCallbacks));
+ _reference->getInstance()->clientThreadPool()->dispatch(new FlushSentRequests(_connection, sentCallbacks));
}
//
@@ -534,11 +528,11 @@ ConnectRequestHandler::flushRequestsWithException()
{
if(p->out)
{
- p->out->finished(*_exception.get(), false);
+ p->out->finished(*_exception.get());
}
else if(p->outAsync)
{
- p->outAsync->__finished(*_exception.get(), false);
+ p->outAsync->__finished(*_exception.get());
}
else
{