diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-05-08 18:51:29 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-05-08 18:51:29 +0000 |
commit | f4d974b7b50b45774c47cc10a9ef42c68d8a9f75 (patch) | |
tree | ecb2a4562cabe2e46d48dc06d1b2fec123239ca5 | |
parent | 8236ed75a7b901c7eb12921d266079b38d279700 (diff) | |
download | ATCD-f4d974b7b50b45774c47cc10a9ef42c68d8a9f75.tar.gz |
ChangeLogTag:Tue May 8 13:28:36 2001 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 94 | ||||
-rw-r--r-- | TAO/tao/Synch_Queued_Message.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Transport.cpp | 41 |
3 files changed, 90 insertions, 46 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b5f10da1458..403d315983b 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,60 +1,86 @@ +Tue May 8 13:28:36 2001 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/Transport.cpp (send_message_i): + Correct buffer manipulation for messages queued after part of + their data was sent, we cannot simply create a + TAO_Asynch_Queued_Message and invoke bytes_transferred() because + the message block chain is modified as part of the send() + attempt. + What we do now is a little different: the message block chain is + modified as data is transferred, only the portion that has not + been sent is put in the queue. So, the fix is also a slight + optimization. + Improve the debugging messages for this code path. + Fix the treatment of a return status of 0 from + send_message_block_chain_i(), this indicates a partial send, not + an EOF. + + * tao/Transport.cpp (send_message_block_chain_i): + If the message was completely sent we should set the + bytes_transferred argument correctly. + + * tao/Synch_Queued_Message.cpp (bytes_transferred): + Update the message blocks that are completely sent, this is used + by higher layers to detect what portion of the message block + chain, if any, has to be queued. + Tue May 8 10:06:58 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * tao/CORBALOC_Parser.cpp (parse_string): - Removed a debug statement that missed the final cleanup before - the commit. + * tao/CORBALOC_Parser.cpp (parse_string): + Removed a debug statement that missed the final cleanup before + the commit. Tue May 8 09:42:02 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * tao/CORBALOC_Parser.cpp (check_prefix): - Provided another test case for the null prefix - in the check_prefix list. + * tao/CORBALOC_Parser.cpp (check_prefix): + Provided another test case for the null prefix + in the check_prefix list. Tue May 8 08:56:32 2001 Ossama Othman <ossama@uci.edu> - * tao/Object_Ref_Table.cpp (TAO_Object_Ref_Table): + * tao/Object_Ref_Table.cpp (TAO_Object_Ref_Table): - Reverted the change "Tue May 8 09:01:13 2001 Balachandran - Natarajan <bala@cs.wustl.edu>". The call to destroy() was - correct since not all applications call ORB::shutdown() (or - ORB::destroy()). In such cases, memory leaks will occur since - the object reference table destroy() method is not explicitly - called. + Reverted the change "Tue May 8 09:01:13 2001 Balachandran + Natarajan <bala@cs.wustl.edu>". The call to destroy() was + correct since not all applications call ORB::shutdown() (or + ORB::destroy()). In such cases, memory leaks will occur since + the object reference table destroy() method is not explicitly + called. - (destroy): + (destroy): - The correct fix for the problem was to call unbind_all() on the - underlying hash table in the destroy() method. Doing so makes - it safe to call the destroy() method more than once. + The correct fix for the problem was to call unbind_all() on the + underlying hash table in the destroy() method. Doing so makes + it safe to call the destroy() method more than once. Tue May 8 10:02:47 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/ORB_Core.cpp: Reverted this change "Tue May 8 07:32:15 2001 - Balachandran Natarajan". The problem on Linux builds seems to be - a manifestation from the problem that was fixed in this change - "Tue May 8 09:01:13 2001 Balachandran Natarajan". + * tao/ORB_Core.cpp: Reverted this change "Tue May 8 07:32:15 2001 + Balachandran Natarajan". The problem on Linux builds seems to be + a manifestation from the problem that was fixed in this change + "Tue May 8 09:01:13 2001 Balachandran Natarajan". Tue May 8 09:01:13 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/Object_Ref_Table.cpp (~TAO_Object_Ref_Table): Removed a - destroy () from the destructor. The destroy () has already been - invoked during ORB_Core::shutdown (). The second call to destroy - () really caused havoc in Win32 builds. + * tao/Object_Ref_Table.cpp (~TAO_Object_Ref_Table): Removed a + destroy () from the destructor. The destroy () has already been + invoked during ORB_Core::shutdown (). The second call to destroy + () really caused havoc in Win32 builds. Tue May 8 08:17:13 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/ORB_Core.h: Added a TAO_Export to TAO_ORB_Core_Auto_Ptr - class. Thanks to Johnny Willemson for reporting this. + * tao/ORB_Core.h: Added a TAO_Export to TAO_ORB_Core_Auto_Ptr + class. Thanks to Johnny Willemson for reporting this. Tue May 8 07:32:15 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/ORB_Core.cpp: Fixed a problem when the client connection - handler is RW. The ORB_Core takes responsibility for closing the - connections. It does so by getting the handles in an Unbounded - Set. When the ORB_Core gets destroyed, the destructor of the - Unbounded set is called. This creates problems as the allocators - have already been removed. We now destroy the list by calling - reset () before the ORB_Core gets destroyed. + * tao/ORB_Core.cpp: Fixed a problem when the client connection + handler is RW. The ORB_Core takes responsibility for closing the + connections. It does so by getting the handles in an Unbounded + Set. When the ORB_Core gets destroyed, the destructor of the + Unbounded set is called. This creates problems as the allocators + have already been removed. We now destroy the list by calling + reset () before the ORB_Core gets destroyed. Mon May 7 20:30:17 2001 Carlos O'Ryan <coryan@uci.edu> diff --git a/TAO/tao/Synch_Queued_Message.cpp b/TAO/tao/Synch_Queued_Message.cpp index 7d62c69468a..a76d964115c 100644 --- a/TAO/tao/Synch_Queued_Message.cpp +++ b/TAO/tao/Synch_Queued_Message.cpp @@ -76,6 +76,7 @@ TAO_Synch_Queued_Message::bytes_transferred (size_t &byte_count) return; } byte_count -= l; + this->current_block_->rd_ptr (l); this->current_block_ = this->current_block_->cont (); while (this->current_block_ != 0 && this->current_block_->length () == 0) diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 54fd4285a67..3adc1a2c916 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -267,6 +267,7 @@ TAO_Transport::send_message_block_chain_i (const ACE_Message_Block *mb, ACE_ASSERT (synch_message.all_data_sent ()); ACE_ASSERT (synch_message.next () == 0); ACE_ASSERT (synch_message.prev () == 0); + bytes_transferred = total_length; return 1; // Empty queue, message was sent.. } @@ -309,7 +310,6 @@ TAO_Transport::send_message_i (TAO_Stub *stub, else if (stub->sync_strategy ().must_queue (queue_empty)) try_sending_first = 0; - size_t byte_count = 0; ssize_t n; TAO_Flushing_Strategy *flushing_strategy = @@ -317,14 +317,16 @@ TAO_Transport::send_message_i (TAO_Stub *stub, if (try_sending_first) { + size_t byte_count = 0; // ... in this case we must try to send the message first ... + size_t total_length = message_block->total_length (); if (TAO_debug_level > 6) { ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Transport[%d]::send_message_i, " - "trying to send the message\n", - this->id ())); + "trying to send the message (ml = %d)\n", + this->id (), total_length)); } // @@ I don't think we want to hold the mutex here, however if @@ -334,9 +336,7 @@ TAO_Transport::send_message_i (TAO_Stub *stub, n = this->send_message_block_chain_i (message_block, byte_count, max_wait_time); - if (n == 0) - return -1; // EOF - else if (n == -1) + if (n == -1) { // ... if this is just an EWOULDBLOCK we must schedule the // message for later, if it is ETIME we still have to send @@ -350,7 +350,7 @@ TAO_Transport::send_message_i (TAO_Stub *stub, } // ... let's figure out if the complete message was sent ... - if (message_block->total_length () == byte_count) + if (total_length == byte_count) { // Done, just return. Notice that there are no allocations // or copies up to this point (though some fancy calling @@ -359,6 +359,23 @@ TAO_Transport::send_message_i (TAO_Stub *stub, // be fast. return 0; } + + if (TAO_debug_level > 6) + { + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Transport[%d]::send_message_i, " + "partial send %d / %d bytes\n", + this->id (), byte_count, total_length)); + } + + // ... part of the data was sent, need to figure out what piece + // of the message block chain must be queued ... + while (message_block != 0 && message_block->length () == 0) + message_block = message_block->cont (); + + // ... at least some portion of the message block chain should + // remain ... + ACE_ASSERT (message_block != 0); } // ... either the message must be queued or we need to queue it @@ -376,7 +393,6 @@ TAO_Transport::send_message_i (TAO_Stub *stub, ACE_NEW_RETURN (queued_message, TAO_Asynch_Queued_Message (message_block), -1); - queued_message->bytes_transferred (byte_count); queued_message->push_back (this->head_, this->tail_); // ... if the queue is full we need to activate the output on the @@ -1009,8 +1025,8 @@ TAO_Transport::cleanup_queue (size_t byte_count) { ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - TAO_Transport::cleanup_queue, " - "byte_count = %d, head_is_empty = %d\n", - byte_count, (this->head_ == 0))); + "byte_count = %d\n", + byte_count)); } // Update the state of the first message @@ -1020,8 +1036,9 @@ TAO_Transport::cleanup_queue (size_t byte_count) { ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - TAO_Transport::cleanup_queue, " - "after transfer, byte_count = %d, all_sent = %d\n", - byte_count, i->all_data_sent ())); + "after transfer, bc = %d, all_sent = %d, ml = %d\n", + byte_count, i->all_data_sent (), + i->message_length ())); } // ... if all the data was sent the message must be removed from |