summaryrefslogtreecommitdiff
path: root/ace/Connector.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-11 13:57:45 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-11 13:57:45 +0000
commit6cc384b6879536f0ce8b3bec92bf8f4abf9f8078 (patch)
treefb82f9cee5f640e59693efadb8f3e32619ad431a /ace/Connector.cpp
parentde5a1d9326c6b5dbe07f77076642db3edcd9cd0e (diff)
downloadATCD-6cc384b6879536f0ce8b3bec92bf8f4abf9f8078.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Connector.cpp')
-rw-r--r--ace/Connector.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/ace/Connector.cpp b/ace/Connector.cpp
index c0acc8e2bd4..14986c5f095 100644
--- a/ace/Connector.cpp
+++ b/ace/Connector.cpp
@@ -50,20 +50,22 @@ template <class SH, PR_CO_1> int
ACE_Connector<SH, PR_CO_2>::activate_svc_handler (SVC_HANDLER *svc_handler)
{
ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::activate_svc_handler");
+ // No errors initially
+ int error = 0;
// See if we should enable non-blocking I/O on the <svc_handler>'s
// peer.
if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0)
{
if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1)
- return -1;
+ error = 1;
}
// Otherwise, make sure it's disabled by default.
else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1)
- return -1;
+ error = 1;
// We are connected now, so try to open things up.
- if (svc_handler->open ((void *) this) == -1)
+ if (error || svc_handler->open ((void *) this) == -1)
{
// Make sure to close down the <svc_handler> to avoid descriptor
// leaks.
@@ -310,7 +312,7 @@ ACE_Connector<SH, PR_CO_2>::handle_output (ACE_HANDLE handle)
// Check to see if we're connected.
if (ast->svc_handler ()->peer ().get_remote_addr (raddr) != -1)
- this->activate_svc_handler (ast->svc_handler ());
+ this->activate_svc_handler (ast->svc_handler ());
else // Somethings gone wrong, so close down...
ast->svc_handler ()->close (0);
@@ -403,7 +405,7 @@ ACE_Connector<SH, PR_CO_2>::cancel (SH *sh)
AST *ast = 0;
this->cleanup_AST (me->ext_id_, ast);
ACE_ASSERT (ast == me->int_id_);
- delete me->int_id_;
+ delete ast;
return 0;
}
@@ -526,7 +528,7 @@ ACE_Connector<SH, PR_CO_2>::handle_close (ACE_HANDLE, ACE_Reactor_Mask mask)
ACE_ASSERT (ast == me->int_id_);
me->int_id_->svc_handler ()->close (0);
- delete me->int_id_;
+ delete ast;
}
}