diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-11-23 01:54:39 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-11-23 01:54:39 +0000 |
commit | 62589481883472fb9dec21eafc20972de58404c8 (patch) | |
tree | c1fc4fa4360b43de7e1a0a82c4f281d164b56a42 | |
parent | 2200fd2f0f89afb97a4574bc01bf1e537c4e8299 (diff) | |
download | ATCD-62589481883472fb9dec21eafc20972de58404c8.tar.gz |
ChangeLogTag:Mon Nov 22 19:53:10 1999 Ossama Othman <othman@cs.wustl.edu>
-rw-r--r-- | ace/SSL/SSL_SOCK_Connector.cpp | 125 | ||||
-rw-r--r-- | ace/SSL/SSL_SOCK_Connector.h | 45 |
2 files changed, 98 insertions, 72 deletions
diff --git a/ace/SSL/SSL_SOCK_Connector.cpp b/ace/SSL/SSL_SOCK_Connector.cpp index 2d51b36f7b4..e6cce0b5b1f 100644 --- a/ace/SSL/SSL_SOCK_Connector.cpp +++ b/ace/SSL/SSL_SOCK_Connector.cpp @@ -75,8 +75,8 @@ ACE_SSL_SOCK_Connector::shared_connect_finish(ACE_SSL_SOCK_Stream &new_stream, error = EWOULDBLOCK; // Wait synchronously using timeout. else if (this->complete (new_stream, - 0, - timeout) == -1) + 0, + timeout) == -1) error = errno; else return 0; @@ -108,26 +108,27 @@ ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, { ACE_TRACE ("ACE_SSL_SOCK_Connector::connect"); if ((new_stream.get_handle () == ACE_INVALID_HANDLE) && - connector_.connect (new_stream.peer (), - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - protocol_family, - protocol) == -1) { + this->connector_.connect (new_stream.peer (), + remote_sap, + timeout, + local_sap, + reuse_addr, + flags, + perms, + protocol_family, + protocol) == -1) { return -1; } - if(new_stream.get_SSL_fd() != new_stream.get_handle()) { - - new_stream.set_SSL_fd((int)new_stream.get_handle()); + if (new_stream.get_SSL_fd () != new_stream.get_handle ()) + { + new_stream.set_SSL_fd ((int)new_stream.get_handle ()); - if(timeout) ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); - } + if (timeout) + ACE::set_flags (new_stream.get_handle (), ACE_NONBLOCK); + } - return((new_stream.connect() == 1) ? 0 : -1); + return new_stream.connect (); } @@ -162,14 +163,15 @@ ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, return -1; } - if(new_stream.get_SSL_fd() != new_stream.get_handle()) { - - new_stream.set_SSL_fd((int)new_stream.get_handle()); + if (new_stream.get_SSL_fd () != new_stream.get_handle ()) + { + new_stream.set_SSL_fd ((int)new_stream.get_handle ()); - if(timeout) ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); - } + if (timeout) + ACE::set_flags (new_stream.get_handle (), ACE_NONBLOCK); + } - return ((new_stream.connect() == 1) ? 0 : 1); + return new_stream.connect (); } // Try to complete a non-blocking connection. @@ -180,20 +182,21 @@ ACE_SSL_SOCK_Connector::complete (ACE_SSL_SOCK_Stream &new_stream, ACE_Time_Value *tv) { ACE_TRACE ("ACE_SSL_SOCK_Connector::complete"); - if (connector_.complete (new_stream.peer (), - remote_sap, - tv) == -1) { + if (this->connector_.complete (new_stream.peer (), + remote_sap, + tv) == -1) { return -1; } - if(new_stream.get_SSL_fd() != new_stream.get_handle()) { - - new_stream.set_SSL_fd((int)new_stream.get_handle()); + if (new_stream.get_SSL_fd () != new_stream.get_handle ()) + { + new_stream.set_SSL_fd ((int)new_stream.get_handle ()); - if(tv) ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); - } + if (tv) + ACE::set_flags (new_stream.get_handle(), ACE_NONBLOCK); + } - return ((new_stream.connect() == 1) ? 0 : -1); + return new_stream.connect (); } @@ -225,16 +228,27 @@ ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( ASYS_TEXT ( "ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector" ))); - else { - if(new_stream.get_SSL_fd() != new_stream.get_handle()) { - - new_stream.set_SSL_fd((int)new_stream.get_handle()); - - if(timeout) ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); + else + { + if (new_stream.get_SSL_fd () != new_stream.get_handle ()) + { + new_stream.set_SSL_fd ((int)new_stream.get_handle ()); + + if (timeout) + ACE::set_flags(new_stream.get_handle (), ACE_NONBLOCK); + } + + if (new_stream.connect () != 0) + { +// ACE_ERROR ((LM_ERROR, +// ASYS_TEXT ("%p\n"), +// ASYS_TEXT ("ACE_SSL_SOCK_Connector::" +// "ACE_SSL_SOCK_Connector" +// ))); + + ::ERR_print_errors_fp (stderr); + } } - - new_stream.connect(); - } } @@ -274,17 +288,26 @@ ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( ASYS_TEXT ( "ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector" ))); - else { - - if(new_stream.get_SSL_fd() != new_stream.get_handle()) { - - new_stream.set_SSL_fd((int)new_stream.get_handle()); - - //if(timeout) ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); + else + { + if (new_stream.get_SSL_fd() != new_stream.get_handle()) + { + new_stream.set_SSL_fd((int)new_stream.get_handle()); + + // if (timeout) + // ACE::set_flags(new_stream.get_handle(), ACE_NONBLOCK); + } + if (new_stream.connect () != 0) + { +// ACE_ERROR ((LM_ERROR, +// ASYS_TEXT ("%p\n"), +// ASYS_TEXT ("ACE_SSL_SOCK_Connector::" +// "ACE_SSL_SOCK_Connector" +// ))); + + ::ERR_print_errors_fp (stderr); + } } - - new_stream.connect(); - } } #endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Connector.h b/ace/SSL/SSL_SOCK_Connector.h index e7ed28f6389..afed3ca162a 100644 --- a/ace/SSL/SSL_SOCK_Connector.h +++ b/ace/SSL/SSL_SOCK_Connector.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- // $Id$ // ============================================================================ @@ -10,7 +10,10 @@ // SSL_SOCK_Connector.h // // = AUTHOR -// John Heitmann and Chris Zimman +// John Heitmann +// Chris Zimman +// Carlos O'Ryan <coryan@cs.wustl.edu> +// Ossama Othman <othman@cs.wustl.edu> // // ============================================================================ @@ -46,14 +49,14 @@ public: // Default constructor. ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); + const ACE_Addr &remote_sap, + ACE_Time_Value *timeout = 0, + const ACE_Addr &local_sap = ACE_Addr::sap_any, + int reuse_addr = 0, + int flags = 0, + int perms = 0, + int protocol_family = PF_INET, + int protocol = 0); // Actively connect and produce a <new_stream> if things go well. // The <remote_sap> is the address that we are trying to connect // with. The <timeout> is the amount of time to wait to connect. @@ -69,17 +72,17 @@ public: // <local_addr> is reused, even if it hasn't been cleanedup yet. ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); + const ACE_Addr &remote_sap, + ACE_QoS_Params qos_params, + ACE_Time_Value *timeout = 0, + const ACE_Addr &local_sap = ACE_Addr::sap_any, + ACE_Protocol_Info *protocolinfo = 0, + ACE_SOCK_GROUP g = 0, + u_long flags = 0, + int reuse_addr = 0, + int perms = 0, + int protocol_family = PF_INET, + int protocol = 0); // Actively connect and produce a <new_stream> if things go well. // The <remote_sap> is the address that we are trying to connect // with. The <qos_params> contains QoS parameters that are passed |