From d5f48cf4388612ee5128aaefbb5722b2b1c26195 Mon Sep 17 00:00:00 2001 From: bala Date: Thu, 28 Dec 2000 11:57:17 +0000 Subject: *** empty log message *** --- TAO/tao/GIOP_Message_Base.cpp | 37 +++++++++++++------------------------ TAO/tao/GIOP_Message_Handler.cpp | 15 ++++++++------- TAO/tao/GIOP_Message_Handler.h | 10 ++++++++-- TAO/tao/GIOP_Message_Handler.inl | 20 ++++++++++++++++---- 4 files changed, 45 insertions(+), 37 deletions(-) diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index bdee5f2b6a0..8245e818ddb 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -80,9 +80,7 @@ void TAO_GIOP_Message_Base::reset (int reset_flag) { // Reset the message state - this->message_handler_.message_state ().reset (reset_flag); - this->message_handler_.message_block ()->reset (); - + this->message_handler_.reset (reset_flag); } int @@ -204,7 +202,7 @@ TAO_GIOP_Message_Base::read_message (TAO_Transport *transport, { size_t len = TAO_GIOP_MESSAGE_HEADER_LEN ; - char *buf = this->message_handler_.message_block ()->rd_ptr (); + char *buf = this->message_handler_.rd_ptr (); buf -= len; size_t msg_len = state.message_size + len; @@ -315,21 +313,21 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, // @@@@Is it necessary here? this->output_->reset (); - // Get the Message Block from the handler - ACE_Message_Block *msg_block = - this->message_handler_.message_block (); + /************************************************************/ + // @@ This comment was there when we were using multiple reads. Let + // it be here till a point it doesn't make sense _ bala // Take out all the information from the and reset // it so that nested upcall on the same transport can be handled. // - // Notice that the message_state is only modified in one thread at a // time because the reactor does not call handle_input() for the // same Event_Handler in two threads at the same time. + /************************************************************/ // Steal the input CDR from the message block - TAO_InputCDR input_cdr (msg_block->data_block ()->duplicate (), - ACE_CDR_BYTE_ORDER, + TAO_InputCDR input_cdr (this->message_handler_.data_block_dup (), + this->message_handler_.message_state ().byte_order, orb_core); @@ -343,11 +341,8 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, // @@@ Needed for DOORS // orb_core->services_log_msg_rcv (this->message_state_); - // Reset the message state. Now, we are ready for the next nested - // upcall if any. - // ###########Wrong???? - msg_block->reset (); - this->message_handler_.message_state ().reset (0); + // Reset the message handler to receive upcalls if any + this->message_handler_.reset (0); int retval = 0; @@ -377,13 +372,9 @@ TAO_GIOP_Message_Base::process_reply_message ( TAO_Pluggable_Reply_Params ¶ms ) { - // Get the Message Block from the handler - ACE_Message_Block *msg_block = - this->message_handler_.message_block (); - // Steal the input CDR from the message block - TAO_InputCDR input_cdr (msg_block->data_block ()->duplicate (), - ACE_CDR_BYTE_ORDER); + TAO_InputCDR input_cdr (this->message_handler_.data_block_dup (), + this->message_handler_.message_state ().byte_order); // When the data block is used for creating the CDR stream, we loose // track of the read pointer of the message block in the message @@ -392,9 +383,7 @@ TAO_GIOP_Message_Base::process_reply_message ( // Reset the message state. Now, we are ready for the next nested // upcall if any. - // ###########Wrong???? - msg_block->reset (); - this->message_handler_.message_state ().reset (0); + this->message_handler_.reset (0); // We know we have some reply message. Check whether it is a // GIOP_REPLY or GIOP_LOCATE_REPLY to take action. diff --git a/TAO/tao/GIOP_Message_Handler.cpp b/TAO/tao/GIOP_Message_Handler.cpp index a8f1267bb4c..d8ede5ab8d4 100644 --- a/TAO/tao/GIOP_Message_Handler.cpp +++ b/TAO/tao/GIOP_Message_Handler.cpp @@ -1,7 +1,9 @@ #include "tao/GIOP_Message_Handler.h" +#include "tao/GIOP_Message_Generator_Parser_Impl.h" +#include "tao/ORB_Core.h" #include "tao/Pluggable.h" #include "tao/debug.h" -#include "tao/GIOP_Message_Generator_Parser_Impl.h" + #if !defined (__ACE_INLINE__) # include "tao/GIOP_Message_Handler.inl" @@ -15,12 +17,11 @@ ACE_RCSID(tao, GIOP_Message_Handler, "$Id$") -TAO_GIOP_Message_Handler:: - TAO_GIOP_Message_Handler (TAO_ORB_Core * orb_core) - : message_status_ (TAO_GIOP_WAITING_FOR_HEADER), - message_size_ (ACE_CDR::DEFAULT_BUFSIZE), - current_buffer_ (message_size_), - message_state_ (orb_core) +TAO_GIOP_Message_Handler::TAO_GIOP_Message_Handler (TAO_ORB_Core * orb_core) + : message_status_ (TAO_GIOP_WAITING_FOR_HEADER), + message_size_ (ACE_CDR::DEFAULT_BUFSIZE), + current_buffer_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE)), + message_state_ (orb_core) { } diff --git a/TAO/tao/GIOP_Message_Handler.h b/TAO/tao/GIOP_Message_Handler.h index 47c266f9b86..728cc53cff8 100644 --- a/TAO/tao/GIOP_Message_Handler.h +++ b/TAO/tao/GIOP_Message_Handler.h @@ -69,8 +69,14 @@ public: /// Return the underlying message state TAO_GIOP_Message_State &message_state (void); - /// Return the pointer to the underlying Message Block - ACE_Message_Block *message_block (void); + /// Return the pointer to the data block within the message block + ACE_Data_Block *data_block (void) const; + + /// Return the pointer to the datablock by duplicating it. + ACE_Data_Block *data_block_dup (void); + + /// Return the rd_ptr of the + char *rd_ptr (void) const; private: diff --git a/TAO/tao/GIOP_Message_Handler.inl b/TAO/tao/GIOP_Message_Handler.inl index eae2ebe2312..2a69fc1186c 100644 --- a/TAO/tao/GIOP_Message_Handler.inl +++ b/TAO/tao/GIOP_Message_Handler.inl @@ -7,13 +7,19 @@ TAO_GIOP_Message_Handler::message_state (void) return this->message_state_; } -ACE_INLINE ACE_Message_Block * -TAO_GIOP_Message_Handler::message_block (void) +ACE_INLINE ACE_Data_Block * +TAO_GIOP_Message_Handler::data_block (void) const { - // The read pointer should be after the GIOP header - return &this->current_buffer_; + return this->current_buffer_.data_block (); } +ACE_INLINE ACE_Data_Block * +TAO_GIOP_Message_Handler::data_block_dup (void) +{ + return this->current_buffer_.data_block ()->duplicate (); +} + + ACE_INLINE void TAO_GIOP_Message_Handler::reset (int /*reset_flag*/) { @@ -23,3 +29,9 @@ TAO_GIOP_Message_Handler::reset (int /*reset_flag*/) // Reset the current buffer this->current_buffer_.reset (); } + +ACE_INLINE char * +TAO_GIOP_Message_Handler::rd_ptr (void) const +{ + return this->current_buffer_.rd_ptr (); +} -- cgit v1.2.1