From fa8504ca1f373da4852caac549249c43e611cc9f Mon Sep 17 00:00:00 2001 From: Chris Cleeland Date: Mon, 3 Nov 1997 23:53:54 +0000 Subject: TAO connector fix --- ChangeLog-97b | 6 ++++++ ace/Connector.cpp | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog-97b b/ChangeLog-97b index 7ce7edba9d0..c8baed6929b 100644 --- a/ChangeLog-97b +++ b/ChangeLog-97b @@ -4,6 +4,12 @@ Mon Nov 3 17:15:17 1997 Steve Huston ACE_CLASS_IS_NAMESPACE macro. Produces warnings on AIX and shouldn't be needed. +Mon Nov 3 15:49:18 1997 Chris Cleeland + + * ace/Connector.cpp (connect): "Fixed" so that the service handler + pointer passed in by the caller doesn't change until the connect + completes without errors. + Mon Nov 3 14:16:37 1997 Nanbor Wang * ace/SV_Semaphore_Complex.cpp (close): Changed to return 0 diff --git a/ace/Connector.cpp b/ace/Connector.cpp index f992709ba3e..8f5c496574e 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -334,10 +334,11 @@ ACE_Connector::connect (SH *&sh, { ACE_TRACE ("ACE_Connector::connect"); + SH* new_sh = sh; // If the user hasn't supplied us with a we'll use the // factory method to create one. Otherwise, things will remain as // they are... - if (this->make_svc_handler (sh) == -1) + if (this->make_svc_handler (new_sh) == -1) return -1; ACE_Time_Value *timeout; @@ -349,7 +350,7 @@ ACE_Connector::connect (SH *&sh, timeout = (ACE_Time_Value *) synch_options.time_value (); // Delegate to connection strategy. - if (this->connect_svc_handler (sh, + if (this->connect_svc_handler (new_sh, remote_addr, timeout, local_addr, @@ -367,6 +368,7 @@ ACE_Connector::connect (SH *&sh, // here because if something goes wrong that will reset // errno this will be detected by the caller (since -1 is // being returned...). + sh = new_sh; this->create_AST (sh, synch_options); } else @@ -377,14 +379,17 @@ ACE_Connector::connect (SH *&sh, int error = errno; // Make sure to close down the Channel to avoid descriptor // leaks. - sh->close (0); + new_sh->close (0); errno = error; } return -1; } else - // Activate immediately if we are connected. - return this->activate_svc_handler (sh); + { + // Activate immediately if we are connected. + sh = new_sh; + return this->activate_svc_handler (sh); + } } // Initiate connection to peer. -- cgit v1.2.1