diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-06-02 00:01:40 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-06-02 00:01:40 +0000 |
commit | 681c6255fda9d0c2ec452863921dec72544772fc (patch) | |
tree | 0a52afcbeb55bdf8ca36b02629be629d6f32552a /TAO/orbsvcs | |
parent | cd23b9f55c59143dcee6b83dd139cffaebb255d0 (diff) | |
download | ATCD-681c6255fda9d0c2ec452863921dec72544772fc.tar.gz |
ChangeLogTag:Fri Jun 1 17:00:53 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp | 48 |
2 files changed, 44 insertions, 10 deletions
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp index cdfc55df14c..5e797c79db5 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp @@ -479,6 +479,12 @@ TAO_SSLIOP_Acceptor::ssliop_open_i (TAO_ORB_Core *orb_core, // the user if provided. this->ssl_component_.port = ssl_address.get_port_number (); + (void) this->ssl_acceptor_.acceptor().enable (ACE_CLOEXEC); + // This avoids having child processes acquire the listen socket + // thereby denying the server the opportunity to restart on a + // well-known endpoint. This does not affect the aberrent behavior + // on Win32 platforms. + if (TAO_debug_level > 5) { for (size_t i = 0; i < this->endpoint_count_; ++i) diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp index 8ed0bb56cf9..97a904a1bf4 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp @@ -95,17 +95,44 @@ TAO_SSLIOP_Connection_Handler::open (void *) // Called by the <Strategy_Acceptor> when the handler is // completely connected. - ACE_INET_Addr addr; - - if (this->peer ().get_remote_addr (addr) == -1) + ACE_INET_Addr remote_addr; + if (this->peer ().get_remote_addr (remote_addr) == -1) return -1; - char client[MAXHOSTNAMELEN + 16]; - if (addr.addr_to_string (client, sizeof (client)) == -1) + ACE_INET_Addr local_addr; + if (this->peer ().get_local_addr (local_addr) == -1) return -1; + if (local_addr.get_ip_address () == remote_addr.get_ip_address () + && local_addr.get_port_number () == remote_addr.get_port_number ()) + { + if (TAO_debug_level > 0) + { + char remote_as_string[MAXHOSTNAMELEN + 16]; + char local_as_string[MAXHOSTNAMELEN + 16]; + + (void) remote_addr.addr_to_string (remote_as_string, + sizeof(remote_as_string)); + (void) local_addr.addr_to_string (local_as_string, + sizeof(local_as_string)); + ACE_ERROR ((LM_ERROR, + "TAO(%P|%t) - TAO_SSLIOP_Connection_Handler::open, " + "Holy Cow! The remote addr and " + "local addr are identical (%s == %s)\n", + remote_as_string, local_as_string)); + } + + return -1; + } + if (TAO_debug_level > 0) { + char client[MAXHOSTNAMELEN + 16]; + + // Verify that we can resolve the peer hostname. + if (remote_addr.addr_to_string (client, sizeof (client)) == -1) + return -1; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) SSLIOP connection from ") ACE_TEXT ("client <%s> on %d\n"), @@ -114,12 +141,13 @@ TAO_SSLIOP_Connection_Handler::open (void *) } // Set the id in the transport now that we're active. + // Use C-style cast b/c otherwise we get warnings on lots of + // compilers. this->transport ()->id ((int) this->get_handle ()); return 0; } - int TAO_SSLIOP_Connection_Handler::activate (long flags, int n_threads, @@ -179,7 +207,7 @@ TAO_SSLIOP_Connection_Handler::handle_close (ACE_HANDLE handle, { if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) SSLIOP_Server_Connection_Handler::handle_close " + "TAO (%P|%t) SSLIOP_Connection_Handler::handle_close " "(%d, %d)\n", handle, rm)); @@ -201,7 +229,7 @@ TAO_SSLIOP_Connection_Handler::handle_close (ACE_HANDLE handle, // Close the handle.. if (this->get_handle () != ACE_INVALID_HANDLE) { - // Purge the entry too + // Mark the entry as invalid. this->transport ()->mark_invalid (); // Signal the transport that we will no longer have @@ -329,11 +357,11 @@ TAO_SSLIOP_Connection_Handler::handle_input_i (ACE_HANDLE, result = this->transport ()->read_process_message (max_wait_time); // Now the message has been read - if (result == -1 && TAO_debug_level > 0) + if (result == -1 && TAO_debug_level > 2) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - %p\n"), - ACE_TEXT ("IIOP_Connection_Handler::read_message \n"))); + ACE_TEXT ("SSLIOP_Connection_Handler::read_message \n"))); } |