diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-02-19 13:47:02 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-02-19 13:47:02 +0000 |
commit | ca1daad2b16f408bc32e4fb9b992c522eb6f419e (patch) | |
tree | c1d8dda08f241a312263f55b36de40036b9a4401 | |
parent | b1a7f951965300404bd1a6b21d2ba3c98291b6d9 (diff) | |
download | ATCD-ca1daad2b16f408bc32e4fb9b992c522eb6f419e.tar.gz |
ChangeLogTag: Tue Feb 19 07:45:05 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/tao/ChangeLog | 8 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.cpp | 38 |
2 files changed, 34 insertions, 12 deletions
diff --git a/TAO/tao/ChangeLog b/TAO/tao/ChangeLog index 515cd9c5767..344e08019b8 100644 --- a/TAO/tao/ChangeLog +++ b/TAO/tao/ChangeLog @@ -1,3 +1,11 @@ +Tue Feb 19 07:45:05 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/IIOP_Connection_Handler.cpp: Added a fix for Jody ie. bug + #1129. Yet, to get a reply whether the fix is right or + wrong. Now, we close the socket with the first call to + handle_close () and delete it when the upcall count gets to + zero. + Mon Feb 11 14:03:18 2002 Balachandran Natarajan <bala@cs.wustl.edu> * tao/Transport.h: Removed the virtual declaration from the method diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 17e1116c9ce..08cf5096338 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -207,7 +207,19 @@ TAO_IIOP_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); + } // If the upcall count is zero start the cleanup. if (upcalls == 0) @@ -239,16 +251,13 @@ TAO_IIOP_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. @@ -353,8 +362,6 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE) // The upcall is done. Bump down the reference count upcalls = this->decr_pending_upcalls (); - ACE_ASSERT (upcalls >= 0); - if (upcalls == 0) { this->handle_close_i (); @@ -364,6 +371,13 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE) // handle_close () which could be harmful. retval = 0; } + else if (upcalls < 0) + { + // As we have already performed the handle closing we dont want + // to return a -1. Doing so would make the reactor call + // handle_close () which could be harmful. + retval = 0; + } if (retval == -1) |