diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-04-14 15:19:21 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-04-14 15:19:21 +0000 |
commit | 22ee40226b7af6fc026612e550ce28a61f45db40 (patch) | |
tree | df0246613a1e6ee6fe478d44e61c4e4723878764 | |
parent | d3a353f7a0195a4a467199b37645ce226486085a (diff) | |
download | ATCD-22ee40226b7af6fc026612e550ce28a61f45db40.tar.gz |
ChangeLogTag:Sun Apr 14 10:31:24 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp | 34 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Connection_Handler.cpp | 28 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp | 35 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Connection_Handler.cpp | 36 |
5 files changed, 95 insertions, 47 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 88b85b79c13..40f75aec11c 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,12 @@ +Sun Apr 14 10:31:24 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Strategies/UIOP_Connection_Handler.cpp: + * tao/Strategies/DIOP_Connection_Handler.cpp: + * tao/Strategies/SHMIOP_Connection_Handler.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: Applied + the fix in "Tue Feb 19 07:45:05 2002 Balachandran Natarajan + <bala@cs.wustl.edu>" for other protocols. + Thu Apr 11 22:07:40 UTC 2002 Don Hinton <dhinton@ieee.org> * tao/TAO_IDL/driver/drv_preproc.cpp: diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp index 6d0285f256a..bf3754f2a3d 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp @@ -217,7 +217,18 @@ TAO_SSLIOP_Connection_Handler::handle_close (ACE_HANDLE handle, long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); + if (upcalls < 0) + return 0; + + if (this->get_handle () != ACE_INVALID_HANDLE) + { + // Just close the socket irrespective of what the upcall count + // is. + this->peer().close (); + + // Set the handle to be INVALID_HANDLE + this->set_handle (ACE_INVALID_HANDLE); + } // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) @@ -248,16 +259,13 @@ TAO_SSLIOP_Connection_Handler::handle_close_i (ACE_HANDLE handle) } // Close the handle.. - if (handle != ACE_INVALID_HANDLE) - { - // Remove the entry as it is invalid - this->transport ()->purge_entry (); + // Remove the entry as it is invalid + this->transport ()->purge_entry (); - // Signal the transport that we will no longer have - // a reference to it. This will eventually call - // TAO_Transport::release (). - this->transport (0); - } + // Signal the transport that we will no longer have + // a reference to it. This will eventually call + // TAO_Transport::release (). + this->transport (0); // Follow usual Reactor-style lifecycle semantics and commit // suicide. @@ -412,8 +420,6 @@ TAO_SSLIOP_Connection_Handler::handle_input (ACE_HANDLE) // The upcall is done. Bump down the reference count long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); - // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) { @@ -424,6 +430,10 @@ TAO_SSLIOP_Connection_Handler::handle_input (ACE_HANDLE) // handle_close() which could be harmful. return 0; } + else if (upcalls < 0) + { + retval = 0; + } // Force this event handler to be called before waiting for // additional events if there is still data in OpenSSL's internal diff --git a/TAO/tao/Strategies/DIOP_Connection_Handler.cpp b/TAO/tao/Strategies/DIOP_Connection_Handler.cpp index 8e7e58529ed..bff7611bd0f 100644 --- a/TAO/tao/Strategies/DIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/DIOP_Connection_Handler.cpp @@ -221,7 +221,18 @@ TAO_DIOP_Connection_Handler::handle_close (ACE_HANDLE handle, long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); + if (upcalls < 0) + return 0; + + if (this->get_handle () != ACE_INVALID_HANDLE) + { + // Just close the socket irrespective of what the upcall count + // is. + this->peer().close (); + + // Set the handle to be INVALID_HANDLE + this->set_handle (ACE_INVALID_HANDLE); + } // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) @@ -258,16 +269,13 @@ TAO_DIOP_Connection_Handler::handle_close_i (void) } // Close the handle.. - if (this->get_handle () != ACE_INVALID_HANDLE) - { - // Remove the entry as it is invalid - this->transport ()->purge_entry (); + // Remove the entry as it is invalid + this->transport ()->purge_entry (); - // Signal the transport that we will no longer have - // a reference to it. This will eventually call - // TAO_Transport::release (). - this->transport (0); - } + // Signal the transport that we will no longer have + // a reference to it. This will eventually call + // TAO_Transport::release (). + this->transport (0); // Follow usual Reactor-style lifecycle semantics and commit // suicide. diff --git a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp index 7a40c3a8de6..2a82524551a 100644 --- a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp @@ -180,7 +180,19 @@ TAO_SHMIOP_Connection_Handler::handle_close (ACE_HANDLE handle, long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); + // Just return incase the upcall count goes below 0. + if (upcalls < 0) + return 0; + + if (this->get_handle () != ACE_INVALID_HANDLE) + { + // Just close the socket irrespective of what the upcall count + // is. + this->peer().close (); + + // Set the handle to be INVALID_HANDLE + this->set_handle (ACE_INVALID_HANDLE); + } // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) @@ -213,16 +225,13 @@ TAO_SHMIOP_Connection_Handler::handle_close_i (void) } // Close the handle.. - if (this->get_handle () != ACE_INVALID_HANDLE) - { - // Remove the entry as it is invalid - this->transport ()->purge_entry (); + // Remove the entry as it is invalid + this->transport ()->purge_entry (); - // Signal the transport that we will no longer have - // a reference to it. This will eventually call - // TAO_Transport::release (). - this->transport (0); - } + // Signal the transport that we will no longer have + // a reference to it. This will eventually call + // TAO_Transport::release (). + this->transport (0); this->destroy (); } @@ -281,8 +290,6 @@ TAO_SHMIOP_Connection_Handler::handle_input (ACE_HANDLE) // The upcall is done. Bump down the reference count long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); - // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) { @@ -293,6 +300,10 @@ TAO_SHMIOP_Connection_Handler::handle_input (ACE_HANDLE) // handle_close () which could be harmful. retval = 0; } + else if (upcalls < 0) + { + retval = 0; + } if (retval == -1) { diff --git a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp index 9d70e4a69fd..d2b7a2e39ad 100644 --- a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp @@ -164,7 +164,19 @@ TAO_UIOP_Connection_Handler::handle_close (ACE_HANDLE handle, long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); + // Just return incase the upcall count goes below 0. + if (upcalls < 0) + return 0; + + if (this->get_handle () != ACE_INVALID_HANDLE) + { + // Just close the socket irrespective of what the upcall count + // is. + this->peer().close (); + + // Set the handle to be INVALID_HANDLE + this->set_handle (ACE_INVALID_HANDLE); + } // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) @@ -194,17 +206,13 @@ TAO_UIOP_Connection_Handler::handle_close_i (void) this->transport ()->wait_strategy ()->is_registered (0); } - // Close the handle.. - if (this->get_handle () != ACE_INVALID_HANDLE) - { - // Remove the entry as it is invalid - this->transport ()->purge_entry (); + // Remove the entry as it is invalid + this->transport ()->purge_entry (); - // Signal the transport that we will no longer have - // a reference to it. This will eventually call - // TAO_Transport::release (). - this->transport (0); - } + // Signal the transport that we will no longer have + // a reference to it. This will eventually call + // TAO_Transport::release (). + this->transport (0); this->destroy (); } @@ -258,8 +266,6 @@ TAO_UIOP_Connection_Handler::handle_input (ACE_HANDLE) // The upcall is done. Bump down the reference count long upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); - // Try to clean up things if the upcall count has reached 0 if (upcalls == 0) { @@ -270,6 +276,10 @@ TAO_UIOP_Connection_Handler::handle_input (ACE_HANDLE) // handle_close () which could be harmful. retval = 0; } + else if (upcalls < 0) + { + retval = 0; + } if (retval == -1) { |