diff options
Diffstat (limited to 'TAO/tao/LF_Connect_Strategy.cpp')
-rw-r--r-- | TAO/tao/LF_Connect_Strategy.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/TAO/tao/LF_Connect_Strategy.cpp b/TAO/tao/LF_Connect_Strategy.cpp index 83ce6483ed1..e20cc3b3aa0 100644 --- a/TAO/tao/LF_Connect_Strategy.cpp +++ b/TAO/tao/LF_Connect_Strategy.cpp @@ -45,15 +45,26 @@ int TAO_LF_Connect_Strategy::wait (TAO_Connection_Handler *ch, ACE_Time_Value *max_wait_time) { - TAO_Transport *transport = - ch->transport (); + ACE_ASSERT(ch != 0); + + // @@todo We need to use a auto_ptr<>-like object here! + // TAO_Transport * transport = ch->get_transport_locked(); + TAO_Transport *transport = ch->transport (); + + // Basically the connection was EINPROGRESS, but before we could + // wait for it some other thread detected a failure and cleaned up + // the connection handler. + if(transport == 0) + { + return -1; + } if (TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - LF_Connect_Strategy::wait, " "waiting for Transport[%d]\n", - transport->id())); + transport->id ())); } TAO_Leader_Follower &leader_follower = @@ -76,5 +87,8 @@ TAO_LF_Connect_Strategy::wait (TAO_Connection_Handler *ch, transport->id(), result)); } + // @@todo We need to use a auto_ptr<>-like object here! + // TAO_Transport::release(transport); + return result; } |