diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-07-19 04:27:45 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-07-19 04:27:45 +0000 |
commit | 1f78d3b40ff355b985585ccda080f6c74ee7a090 (patch) | |
tree | ad9f96703aaaccab9a528beb05cebffbcda6a817 /TAO/tao/Transport.cpp | |
parent | 7aa7daea643d0ccddb521f9ca38411349cf25177 (diff) | |
download | ATCD-1f78d3b40ff355b985585ccda080f6c74ee7a090.tar.gz |
ChangeLogTag:Tue Jul 18 11:25:31 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Transport.cpp')
-rw-r--r-- | TAO/tao/Transport.cpp | 86 |
1 files changed, 65 insertions, 21 deletions
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 9b078de6d5e..20bfd7e4ba4 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -1042,31 +1042,14 @@ TAO_Transport::consolidate_message (ACE_Message_Block &incoming, "queueing up the message \n", this->id ())); } - // Get an instance of TAO_Queued_Data - TAO_Queued_Data *qd = TAO_Queued_Data::get_queued_data (); + + // Get a queued data + TAO_Queued_Data *qd = + this->make_queued_data (incoming); // Add the missing data to the queue qd->missing_data_ = missing_data; - // Get the flag for the details of the data block... - ACE_Message_Block::Message_Flags flg = incoming.self_flags (); - - if (ACE_BIT_DISABLED (flg, - ACE_Message_Block::DONT_DELETE)) - { - // Duplicate the data block before putting it in the queue. - qd->msg_block_ = ACE_Message_Block::duplicate (&incoming); - } - else - { - // As we are in CORBA mode, all the data blocks would be aligned - // on an 8 byte boundary - ACE_Message_Block msgb (incoming, - ACE_CDR::MAX_ALIGNMENT); - - qd->msg_block_ = ACE_Message_Block::duplicate (&msgb); - } - // Get the rest of the messaging data this->messaging_object ()->get_message_data (qd); @@ -1140,6 +1123,27 @@ TAO_Transport::consolidate_message_queue (ACE_Message_Block &incoming, } return retval; } + else if (retval == 1) + { + // If the message in the <incoming> message block has only + // one message left we need to process that seperately. + + // Get a queued data + TAO_Queued_Data *qd = this->make_queued_data (incoming); + + // Get the rest of the message data + this->messaging_object ()->get_message_data (qd); + + // Add the missing data to the queue + qd->missing_data_ = 0; + + // Add it to the tail of the queue.. + this->incoming_message_queue_.enqueue_tail (qd); + + // We should surely have a message in queue now. So just + // process that. + return this->process_queue_head (rh); + } // parse_consolidate_messages () would have processed one of the // messages, so we better return as we dont want to starve other @@ -1371,6 +1375,46 @@ TAO_Transport::process_parsed_messages (TAO_Queued_Data *qd) return 0; } +TAO_Queued_Data * +TAO_Transport::make_queued_data (ACE_Message_Block &incoming) +{ + // Get an instance of TAO_Queued_Data + TAO_Queued_Data *qd = TAO_Queued_Data::get_queued_data (); + + // Get the flag for the details of the data block... + ACE_Message_Block::Message_Flags flg = incoming.self_flags (); + + if (ACE_BIT_DISABLED (flg, + ACE_Message_Block::DONT_DELETE)) + { + // Duplicate the data block before putting it in the queue. + qd->msg_block_ = ACE_Message_Block::duplicate (&incoming); + } + else + { + // As we are in CORBA mode, all the data blocks would be aligned + // on an 8 byte boundary + ACE_Message_Block msgb (incoming, + ACE_CDR::MAX_ALIGNMENT); + + qd->msg_block_ = ACE_Message_Block::duplicate (&msgb); + + // Get the base pointer of the incoming message block + char *start = ACE_ptr_align_binary (incoming.base (), + ACE_CDR::MAX_ALIGNMENT); + + // Get the read and write displacements in the incoming stream + size_t rd_pos = incoming.rd_ptr () - start; + size_t wr_pos = incoming.wr_ptr () - start; + + qd->msg_block_->rd_ptr (rd_pos); + qd->msg_block_->wr_ptr (rd_pos); + } + + + return qd; +} + int TAO_Transport::process_queue_head (TAO_Resume_Handle &rh) { |