summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectionRequestHandler.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-09-26 18:39:28 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-09-26 18:39:28 +0200
commitaa3c4ebfa279188cf689c6ef2318ed573c4fec7b (patch)
treec7c1c9b7b6ce2daee3cd9b5507a49d3520fd1d06 /cpp/src/Ice/ConnectionRequestHandler.cpp
parentSlightly improved fix for ICE-3692 (diff)
downloadice-aa3c4ebfa279188cf689c6ef2318ed573c4fec7b.tar.bz2
ice-aa3c4ebfa279188cf689c6ef2318ed573c4fec7b.tar.xz
ice-aa3c4ebfa279188cf689c6ef2318ed573c4fec7b.zip
Fixed deadlock in connection binding code (ICE-5693)
Diffstat (limited to 'cpp/src/Ice/ConnectionRequestHandler.cpp')
-rw-r--r--cpp/src/Ice/ConnectionRequestHandler.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/src/Ice/ConnectionRequestHandler.cpp b/cpp/src/Ice/ConnectionRequestHandler.cpp
index 4d9d746675d..43dda1b88ed 100644
--- a/cpp/src/Ice/ConnectionRequestHandler.cpp
+++ b/cpp/src/Ice/ConnectionRequestHandler.cpp
@@ -38,6 +38,40 @@ ConnectionRequestHandler::ConnectionRequestHandler(const ReferencePtr& reference
{
}
+RequestHandlerPtr
+ConnectionRequestHandler::connect()
+{
+ assert(false); // This request handler is only created after connection binding.
+ return 0;
+}
+
+RequestHandlerPtr
+ConnectionRequestHandler::update(const RequestHandlerPtr& previousHandler, const RequestHandlerPtr& newHandler)
+{
+ assert(previousHandler);
+ try
+ {
+ if(previousHandler.get() == this)
+ {
+ return newHandler;
+ }
+ else if(previousHandler->getConnection() == _connection)
+ {
+ //
+ // If both request handlers point to the same connection, we also
+ // update the request handler. See bug ICE-5489 for reasons why
+ // this can be useful.
+ //
+ return newHandler;
+ }
+ }
+ catch(const Ice::Exception&)
+ {
+ // Ignore.
+ }
+ return this;
+}
+
void
ConnectionRequestHandler::prepareBatchRequest(BasicStream* out)
{