diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-04-15 00:05:42 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-04-15 00:05:42 +0000 |
commit | f7dc76ca58ff0e1a56b710a5023df6360b0583e3 (patch) | |
tree | 5654675338abf6b2a8cc02ea21f39d5066367758 /TAO/tao/GIOP_Message_Base.cpp | |
parent | 80574755fb6685cddcdfca8a4dfca1dda820696b (diff) | |
download | ATCD-f7dc76ca58ff0e1a56b710a5023df6360b0583e3.tar.gz |
ChangeLogTag: Sun Apr 14 19:02:16 2002 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/GIOP_Message_Base.cpp')
-rw-r--r-- | TAO/tao/GIOP_Message_Base.cpp | 931 |
1 files changed, 465 insertions, 466 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 0e420b21688..b6cdc7fa5b1 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -3,15 +3,14 @@ #include "GIOP_Message_Base.h" #include "operation_details.h" #include "GIOP_Utils.h" -#include "Pluggable.h" #include "debug.h" #include "ORB_Core.h" #include "Leader_Follower.h" #include "TAO_Server_Request.h" #include "GIOP_Message_Locate_Header.h" #include "Transport.h" -#include "tao/LF_Strategy.h" -#include "tao/Request_Dispatcher.h" +#include "LF_Strategy.h" +#include "Request_Dispatcher.h" #if !defined (__ACE_INLINE__) # include "GIOP_Message_Base.i" @@ -20,10 +19,10 @@ ACE_RCSID (tao, GIOP_Message_Base, "$Id$") TAO_GIOP_Message_Base::TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core, - size_t /*input_cdr_size*/) + size_t /*input_cdr_size*/) : orb_core_ (orb_core), message_state_ (orb_core, - this) + this) { } @@ -37,7 +36,7 @@ TAO_GIOP_Message_Base::~TAO_GIOP_Message_Base (void) void TAO_GIOP_Message_Base::init (CORBA::Octet /*major*/, - CORBA::Octet /*minor*/) + CORBA::Octet /*minor*/) { // Set the state // this->set_state (major, minor); @@ -66,28 +65,28 @@ TAO_GIOP_Message_Base::generate_request_header ( // Get the state information that we need to use this->set_state (major, - minor, - generator_parser); + minor, + generator_parser); // Write the GIOP header first if (!this->write_protocol_header (TAO_GIOP_REQUEST, - cdr)) + cdr)) { if (TAO_debug_level) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); return -1; } // Now call the implementation for the rest of the header if (!generator_parser->write_request_header (op, - spec, - cdr)) + spec, + cdr)) { if (TAO_debug_level) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("(%P|%t) Error in writing request header \n"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("(%P|%t) Error in writing request header \n"))); return -1; } @@ -111,16 +110,16 @@ TAO_GIOP_Message_Base::generate_locate_request_header ( // Get the state information that we need to use this->set_state (major, - minor, - generator_parser); + minor, + generator_parser); // Write the GIOP header first if (!this->write_protocol_header (TAO_GIOP_LOCATEREQUEST, - cdr)) + cdr)) { if (TAO_debug_level) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); return -1; } @@ -132,8 +131,8 @@ TAO_GIOP_Message_Base::generate_locate_request_header ( cdr)) { if (TAO_debug_level) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("(%P|%t) Error in writing locate request header \n"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("(%P|%t) Error in writing locate request header \n"))); return -1; @@ -158,16 +157,16 @@ TAO_GIOP_Message_Base::generate_reply_header ( // Get the state information that we need to use this->set_state (major, - minor, - generator_parser); + minor, + generator_parser); // Write the GIOP header first if (!this->write_protocol_header (TAO_GIOP_REPLY, - cdr)) + cdr)) { if (TAO_debug_level) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("(%P|%t) Error in writing GIOP header \n"))); return -1; } @@ -177,26 +176,26 @@ TAO_GIOP_Message_Base::generate_reply_header ( { // Now call the implementation for the rest of the header int result = - generator_parser->write_reply_header (cdr, - params - ACE_ENV_ARG_PARAMETER); + generator_parser->write_reply_header (cdr, + params + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (!result) - { - if (TAO_debug_level > 4) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) Error in writing reply ") - ACE_TEXT ("header\n"))); - - return -1; - } + { + if (TAO_debug_level > 4) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Error in writing reply ") + ACE_TEXT ("header\n"))); + + return -1; + } } ACE_CATCHANY { if (TAO_debug_level > 4) - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "TAO_GIOP_Message_Base::generate_reply_header"); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "TAO_GIOP_Message_Base::generate_reply_header"); return -1; } @@ -208,8 +207,8 @@ TAO_GIOP_Message_Base::generate_reply_header ( int TAO_GIOP_Message_Base::read_message (TAO_Transport * /*transport*/, - int /*block */, - ACE_Time_Value * /*max_wait_time*/) + int /*block */, + ACE_Time_Value * /*max_wait_time*/) { return 0; } @@ -235,15 +234,15 @@ TAO_GIOP_Message_Base::format_message (TAO_OutputCDR &stream) #if !defined (ACE_ENABLE_SWAP_ON_WRITE) *ACE_reinterpret_cast (CORBA::ULong *, buf + - TAO_GIOP_MESSAGE_SIZE_OFFSET) = bodylen; + TAO_GIOP_MESSAGE_SIZE_OFFSET) = bodylen; #else if (!stream.do_byte_swap ()) *ACE_reinterpret_cast (CORBA::ULong *, - buf + TAO_GIOP_MESSAGE_SIZE_OFFSET) = bodylen; + buf + TAO_GIOP_MESSAGE_SIZE_OFFSET) = bodylen; else ACE_CDR::swap_4 (ACE_reinterpret_cast (char *, - &bodylen), - buf + TAO_GIOP_MESSAGE_SIZE_OFFSET); + &bodylen), + buf + TAO_GIOP_MESSAGE_SIZE_OFFSET); #endif /* ACE_ENABLE_SWAP_ON_WRITE */ if (TAO_debug_level > 2) @@ -253,16 +252,16 @@ TAO_GIOP_Message_Base::format_message (TAO_OutputCDR &stream) // dumped ACE_Message_Block* consolidated_block = 0; if (stream.begin()->cont () != 0) - { - consolidated_block = new ACE_Message_Block; - ACE_CDR::consolidate (consolidated_block, stream.begin ()); - buf = (char *) (consolidated_block->rd_ptr ()); - } + { + consolidated_block = new ACE_Message_Block; + ACE_CDR::consolidate (consolidated_block, stream.begin ()); + buf = (char *) (consolidated_block->rd_ptr ()); + } /// this->dump_msg ("send", - ACE_reinterpret_cast (u_char *, - buf), - total_len); + ACE_reinterpret_cast (u_char *, + buf), + total_len); // delete consolidated_block; @@ -301,9 +300,9 @@ TAO_GIOP_Message_Base::message_type ( case TAO_GIOP_CANCELREQUEST: // Does it happen? why?? default: - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) %N:%l message_type : ") - ACE_TEXT ("wrong message.\n"))); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) %N:%l message_type : ") + ACE_TEXT ("wrong message.\n"))); } return TAO_PLUGGABLE_MESSAGE_MESSAGERROR; @@ -346,24 +345,24 @@ TAO_GIOP_Message_Base::missing_data (ACE_Message_Block &incoming) int TAO_GIOP_Message_Base::extract_next_message (ACE_Message_Block &incoming, - TAO_Queued_Data *&qd) + TAO_Queued_Data *&qd) { TAO_GIOP_Message_State state (this->orb_core_, - this); + this); if (incoming.length () < TAO_GIOP_MESSAGE_HEADER_LEN) { if (incoming.length () > 0) - { - // Make a node which has a message block of the size of - // MESSAGE_HEADER_LEN. - qd = - this->make_queued_data (TAO_GIOP_MESSAGE_HEADER_LEN); - - qd->msg_block_->copy (incoming.rd_ptr (), - incoming.length ()); - qd->missing_data_ = -1; - } + { + // Make a node which has a message block of the size of + // MESSAGE_HEADER_LEN. + qd = + this->make_queued_data (TAO_GIOP_MESSAGE_HEADER_LEN); + + qd->msg_block_->copy (incoming.rd_ptr (), + incoming.length ()); + qd->missing_data_ = -1; + } return 0; } @@ -379,13 +378,13 @@ TAO_GIOP_Message_Base::extract_next_message (ACE_Message_Block &incoming, if (copying_len > incoming.length ()) { qd->missing_data_ = - copying_len - incoming.length (); + copying_len - incoming.length (); copying_len = incoming.length (); } qd->msg_block_->copy (incoming.rd_ptr (), - copying_len); + copying_len); incoming.rd_ptr (copying_len); qd->byte_order_ = state.byte_order_; @@ -397,7 +396,7 @@ TAO_GIOP_Message_Base::extract_next_message (ACE_Message_Block &incoming, int TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd, - ACE_Message_Block &incoming) + ACE_Message_Block &incoming) { // Look to see whether we had atleast parsed the GIOP header ... if (qd->missing_data_ == -1) @@ -405,54 +404,54 @@ TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd, // The data length that has been stuck in there during the last // read .... size_t len = - qd->msg_block_->length (); + qd->msg_block_->length (); // We know that we would have space for // TAO_GIOP_MESSAGE_HEADER_LEN here. So copy that much of data // from the <incoming> into the message block in <qd> qd->msg_block_->copy (incoming.rd_ptr (), - TAO_GIOP_MESSAGE_HEADER_LEN - len); + TAO_GIOP_MESSAGE_HEADER_LEN - len); // Move the rd_ptr () in the incoming message block.. incoming.rd_ptr (TAO_GIOP_MESSAGE_HEADER_LEN - len); TAO_GIOP_Message_State state (this->orb_core_, - this); + this); // Parse the message header now... if (state.parse_message_header (*qd->msg_block_) == -1) - return -1; + return -1; // Now grow the message block so that we can copy the rest of // the data... ACE_CDR::grow (qd->msg_block_, - state.message_size ()); + state.message_size ()); // Copy the pay load.. // Calculate the bytes that needs to be copied in the queue... - size_t copy_len = state.payload_size (); + size_t copy_len = state.payload_size (); // If teh data that needs to be copied is more than that is // available to us .. if (copy_len > incoming.length ()) - { - // Calculate the missing data.. - qd->missing_data_ = - copy_len - incoming.length (); - - // Set the actual possible copy_len that is available... - copy_len = incoming.length (); - } + { + // Calculate the missing data.. + qd->missing_data_ = + copy_len - incoming.length (); + + // Set the actual possible copy_len that is available... + copy_len = incoming.length (); + } else - { - qd->missing_data_ = 0; - } + { + qd->missing_data_ = 0; + } // ..now we are set to copy the right amount of data to the // node.. qd->msg_block_->copy (incoming.rd_ptr (), - copy_len); + copy_len); // Set the <rd_ptr> of the <incoming>.. incoming.rd_ptr (copy_len); @@ -469,19 +468,19 @@ TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd, size_t copy_len = qd->missing_data_; if (copy_len > incoming.length ()) - { - // Calculate the missing data.. - qd->missing_data_ = - copy_len - incoming.length (); + { + // Calculate the missing data.. + qd->missing_data_ = + copy_len - incoming.length (); - // Set the actual possible copy_len that is available... - copy_len = incoming.length (); - } + // Set the actual possible copy_len that is available... + copy_len = incoming.length (); + } // Copy the right amount of data in to the node... // node.. qd->msg_block_->copy (incoming.rd_ptr (), - copy_len); + copy_len); // Set the <rd_ptr> of the <incoming>.. qd->msg_block_->rd_ptr (copy_len); @@ -495,7 +494,7 @@ TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd, int TAO_GIOP_Message_Base::consolidate_fragments (TAO_Queued_Data *dqd, - const TAO_Queued_Data *sqd) + const TAO_Queued_Data *sqd) { if (dqd->byte_order_ != sqd->byte_order_ || dqd->major_version_ != sqd->major_version_ @@ -504,8 +503,8 @@ TAO_GIOP_Message_Base::consolidate_fragments (TAO_Queued_Data *dqd, // Yes, print it out in all debug levels!. This is an error by // CORBA 2.4 spec ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) incompatible fragments:") - ACE_TEXT ("different GIOP versions or byte order\n"))); + ACE_TEXT ("TAO (%P|%t) incompatible fragments:") + ACE_TEXT ("different GIOP versions or byte order\n"))); return -1; } @@ -524,11 +523,11 @@ TAO_GIOP_Message_Base::consolidate_fragments (TAO_Queued_Data *dqd, ACE_Message_Block *mb = dqd->msg_block_; ACE_CDR::grow (mb, - mb->size () + incoming_size); + mb->size () + incoming_size); // Copy the data dqd->msg_block_->copy (sqd->msg_block_->rd_ptr (), - incoming_size); + incoming_size); return 0; } @@ -560,7 +559,7 @@ TAO_GIOP_Message_Base::get_message_data (TAO_Queued_Data *qd) int TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, - TAO_Queued_Data *qd) + TAO_Queued_Data *qd) { // Set the upcall thread @@ -571,30 +570,30 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, // Get the state information that we need to use this->set_state (qd->major_version_, - qd->minor_version_, - generator_parser); + qd->minor_version_, + generator_parser); // A buffer that we will use to initialise the CDR stream char repbuf[ACE_CDR::DEFAULT_BUFSIZE]; #if defined(ACE_HAS_PURIFY) (void) ACE_OS::memset (repbuf, - '\0', - sizeof repbuf); + '\0', + sizeof repbuf); #endif /* ACE_HAS_PURIFY */ // Initialze an output CDR on the stack TAO_OutputCDR output (repbuf, - sizeof repbuf, - TAO_ENCAP_BYTE_ORDER, - this->orb_core_->output_cdr_buffer_allocator (), - this->orb_core_->output_cdr_dblock_allocator (), - this->orb_core_->output_cdr_msgblock_allocator (), - this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (), - qd->major_version_, - qd->minor_version_, - this->orb_core_->to_iso8859 (), - this->orb_core_->to_unicode ()); + sizeof repbuf, + TAO_ENCAP_BYTE_ORDER, + this->orb_core_->output_cdr_buffer_allocator (), + this->orb_core_->output_cdr_dblock_allocator (), + this->orb_core_->output_cdr_msgblock_allocator (), + this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (), + qd->major_version_, + qd->minor_version_, + this->orb_core_->to_iso8859 (), + this->orb_core_->to_unicode ()); // Get the read and write positions before we steal data. size_t rd_pos = qd->msg_block_->rd_ptr () - qd->msg_block_->base (); @@ -603,17 +602,17 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, if (TAO_debug_level > 0) this->dump_msg ("recv", - ACE_reinterpret_cast (u_char *, - qd->msg_block_->rd_ptr ()), - qd->msg_block_->length ()); + ACE_reinterpret_cast (u_char *, + qd->msg_block_->rd_ptr ()), + qd->msg_block_->length ()); // Create a input CDR stream. We do the following // 1 - If the incoming message block has a data block with a flag - // DONT_DELETE (for the data block) we create an input CDR - // stream the same way. + // DONT_DELETE (for the data block) we create an input CDR + // stream the same way. // 2 - If the incoming message block had a datablock from heap just - // use it by duplicating it and make the flag 0. + // use it by duplicating it and make the flag 0. // NOTE: We use the same data block in which we read the message and // we pass it on to the higher layers of the ORB. So we dont to any // copies at all here. The same is also done in the higher layers. @@ -625,7 +624,7 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, flg = qd->msg_block_->self_flags (); if (ACE_BIT_ENABLED (flg, - ACE_Message_Block::DONT_DELETE)) + ACE_Message_Block::DONT_DELETE)) { // Use the same datablock db = qd->msg_block_->data_block (); @@ -639,13 +638,13 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, TAO_InputCDR input_cdr (db, - flg, - rd_pos, - wr_pos, - qd->byte_order_, - qd->major_version_, - qd->minor_version_, - this->orb_core_); + flg, + rd_pos, + wr_pos, + qd->byte_order_, + qd->major_version_, + qd->minor_version_, + this->orb_core_); // We know we have some request message. Check whether it is a @@ -662,15 +661,15 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, // could raise an exception or write things in the output CDR // stream return this->process_request (transport, - input_cdr, - output, - generator_parser); + input_cdr, + output, + generator_parser); case TAO_PLUGGABLE_MESSAGE_LOCATEREQUEST: return this->process_locate_request (transport, - input_cdr, - output, - generator_parser); + input_cdr, + output, + generator_parser); default: return -1; } @@ -686,8 +685,8 @@ TAO_GIOP_Message_Base::process_reply_message ( // Get the state information that we need to use this->set_state (qd->major_version_, - qd->minor_version_, - generator_parser); + qd->minor_version_, + generator_parser); // Get the read and write positions before we steal data. size_t rd_pos = qd->msg_block_->rd_ptr () - qd->msg_block_->base (); @@ -696,9 +695,9 @@ TAO_GIOP_Message_Base::process_reply_message ( if (TAO_debug_level > 0) this->dump_msg ("recv", - ACE_reinterpret_cast (u_char *, - qd->msg_block_->rd_ptr ()), - qd->msg_block_->length ()); + ACE_reinterpret_cast (u_char *, + qd->msg_block_->rd_ptr ()), + qd->msg_block_->length ()); // Create a empty buffer on stack @@ -706,13 +705,13 @@ TAO_GIOP_Message_Base::process_reply_message ( // we pass it on to the higher layers of the ORB. So we dont to any // copies at all here. The same is alos done in the higher layers. TAO_InputCDR input_cdr (qd->msg_block_->data_block (), - ACE_Message_Block::DONT_DELETE, - rd_pos, - wr_pos, - qd->byte_order_, - qd->major_version_, - qd->minor_version_, - this->orb_core_); + ACE_Message_Block::DONT_DELETE, + rd_pos, + wr_pos, + qd->byte_order_, + qd->major_version_, + qd->minor_version_, + this->orb_core_); // Reset the message state. Now, we are ready for the next nested // upcall if any. @@ -730,13 +729,13 @@ TAO_GIOP_Message_Base::process_reply_message ( case TAO_PLUGGABLE_MESSAGE_REPLY: // Should be taken care by the state specific parsing return generator_parser->parse_reply (input_cdr, - params); + params); case TAO_PLUGGABLE_MESSAGE_LOCATEREPLY: return generator_parser->parse_locate_reply (input_cdr, - params); + params); default: - return -1; + return -1; } } @@ -755,7 +754,7 @@ TAO_GIOP_Message_Base::generate_exception_reply ( { // Make the GIOP & reply header. this->generate_reply_header (cdr, - params); + params); x._tao_encode (cdr ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -766,8 +765,8 @@ TAO_GIOP_Message_Base::generate_exception_reply ( // Close the handle. ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t|%N|%l) cannot marshal exception, ") - ACE_TEXT ("generate_exception_reply ()"))); + ACE_TEXT ("(%P|%t|%N|%l) cannot marshal exception, ") + ACE_TEXT ("generate_exception_reply ()"))); return -1; } ACE_ENDTRY; @@ -778,7 +777,7 @@ TAO_GIOP_Message_Base::generate_exception_reply ( int TAO_GIOP_Message_Base::write_protocol_header (TAO_GIOP_Message_Type t, - TAO_OutputCDR &msg) + TAO_OutputCDR &msg) { // Reset the message type // Reset the message type @@ -816,17 +815,17 @@ TAO_GIOP_Message_Base::write_protocol_header (TAO_GIOP_Message_Type t, int TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, - TAO_InputCDR &cdr, - TAO_OutputCDR &output, - TAO_GIOP_Message_Generator_Parser *parser) + TAO_InputCDR &cdr, + TAO_OutputCDR &output, + TAO_GIOP_Message_Generator_Parser *parser) { // This will extract the request header, set <response_required> // and <sync_with_server> as appropriate. TAO_ServerRequest request (this, - cdr, - output, - transport, - this->orb_core_); + cdr, + output, + transport, + this->orb_core_); CORBA::ULong request_id = 0; CORBA::Boolean response_required = 0; @@ -837,12 +836,12 @@ TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, ACE_TRY { parse_error = - parser->parse_request_header (request); + parser->parse_request_header (request); // Throw an exception if the if (parse_error != 0) - ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_NO)); + ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_NO)); request_id = request.request_id (); response_required = request.response_expected (); @@ -851,52 +850,52 @@ TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, // Do this before the reply is sent. this->orb_core_->request_dispatcher ()->dispatch ( - this->orb_core_, - request, - forward_to - ACE_ENV_ARG_PARAMETER); + this->orb_core_, + request, + forward_to + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (!CORBA::is_nil (forward_to.in ())) - { - // We should forward to another object... - TAO_Pluggable_Reply_Params_Base reply_params; - reply_params.request_id_ = request_id; - reply_params.reply_status_ = TAO_GIOP_LOCATION_FORWARD; - reply_params.svc_ctx_.length (0); - - // Send back the reply service context. - reply_params.service_context_notowned (&request.reply_service_info ()); - - // Make the GIOP header and Reply header - this->generate_reply_header (output, - reply_params); - - if (!(output << forward_to.in ())) - { - if (TAO_debug_level > 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) ERROR: Unable to marshal ") - ACE_TEXT ("forward reference.\n"))); - - return -1; - } - - int result = transport->send_message (output); - if (result == -1) - { - if (TAO_debug_level > 0) - { - // No exception but some kind of error, yet a - // response is required. - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") - ACE_TEXT ("cannot send reply\n"), - ACE_TEXT ("TAO_GIOP_Message_Base::process_request"))); - } - } - return result; - } + { + // We should forward to another object... + TAO_Pluggable_Reply_Params_Base reply_params; + reply_params.request_id_ = request_id; + reply_params.reply_status_ = TAO_GIOP_LOCATION_FORWARD; + reply_params.svc_ctx_.length (0); + + // Send back the reply service context. + reply_params.service_context_notowned (&request.reply_service_info ()); + + // Make the GIOP header and Reply header + this->generate_reply_header (output, + reply_params); + + if (!(output << forward_to.in ())) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) ERROR: Unable to marshal ") + ACE_TEXT ("forward reference.\n"))); + + return -1; + } + + int result = transport->send_message (output); + if (result == -1) + { + if (TAO_debug_level > 0) + { + // No exception but some kind of error, yet a + // response is required. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") + ACE_TEXT ("cannot send reply\n"), + ACE_TEXT ("TAO_GIOP_Message_Base::process_request"))); + } + } + return result; + } } // Only CORBA exceptions are caught here. ACE_CATCHANY @@ -904,44 +903,44 @@ TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, int result = 0; if (response_required) - { - result = this->send_reply_exception (transport, - this->orb_core_, - request_id, - &request.reply_service_info (), - &ACE_ANY_EXCEPTION); - if (result == -1) - { - if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") - ACE_TEXT ("cannot send exception\n"), - ACE_TEXT ("process_connector_request ()"))); - - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO_GIOP_Message_Base::process_request[1]"); - } - } - - } + { + result = this->send_reply_exception (transport, + this->orb_core_, + request_id, + &request.reply_service_info (), + &ACE_ANY_EXCEPTION); + if (result == -1) + { + if (TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") + ACE_TEXT ("cannot send exception\n"), + ACE_TEXT ("process_connector_request ()"))); + + ACE_PRINT_EXCEPTION ( + ACE_ANY_EXCEPTION, + "TAO_GIOP_Message_Base::process_request[1]"); + } + } + + } else if (TAO_debug_level > 0) - { - // It is unfotunate that an exception (probably a system - // exception) was thrown by the upcall code (even by the - // user) when the client was not expecting a response. - // However, in this case, we cannot close the connection - // down, since it really isn't the client's fault. - - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) exception thrown ") - ACE_TEXT ("but client is not waiting a response\n"))); - - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO_GIOP_Message_Base::process_request[2]"); - } + { + // It is unfotunate that an exception (probably a system + // exception) was thrown by the upcall code (even by the + // user) when the client was not expecting a response. + // However, in this case, we cannot close the connection + // down, since it really isn't the client's fault. + + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) exception thrown ") + ACE_TEXT ("but client is not waiting a response\n"))); + + ACE_PRINT_EXCEPTION ( + ACE_ANY_EXCEPTION, + "TAO_GIOP_Message_Base::process_request[2]"); + } return result; } @@ -958,41 +957,41 @@ TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, int result = 0; if (response_required) - { - CORBA::UNKNOWN exception (CORBA::SystemException::_tao_minor_code - (TAO_UNHANDLED_SERVER_CXX_EXCEPTION, 0), - CORBA::COMPLETED_MAYBE); - - result = this->send_reply_exception (transport, - this->orb_core_, - request_id, - &request.reply_service_info (), - &exception); - if (result == -1) - { - if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") - ACE_TEXT ("cannot send exception\n"), - ACE_TEXT ("process_request ()"))); - ACE_PRINT_EXCEPTION ( - exception, - "TAO_GIOP_Message_Base::process_request[3]"); - } - } - } + { + CORBA::UNKNOWN exception (CORBA::SystemException::_tao_minor_code + (TAO_UNHANDLED_SERVER_CXX_EXCEPTION, 0), + CORBA::COMPLETED_MAYBE); + + result = this->send_reply_exception (transport, + this->orb_core_, + request_id, + &request.reply_service_info (), + &exception); + if (result == -1) + { + if (TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO: (%P|%t|%N|%l) %p: ") + ACE_TEXT ("cannot send exception\n"), + ACE_TEXT ("process_request ()"))); + ACE_PRINT_EXCEPTION ( + exception, + "TAO_GIOP_Message_Base::process_request[3]"); + } + } + } else if (TAO_debug_level > 0) - { - // It is unfotunate that an exception (probably a system - // exception) was thrown by the upcall code (even by the - // user) when the client was not expecting a response. - // However, in this case, we cannot close the connection - // down, since it really isn't the client's fault. - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t|%N|%l) exception thrown ") - ACE_TEXT ("but client is not waiting a response\n"))); - } + { + // It is unfotunate that an exception (probably a system + // exception) was thrown by the upcall code (even by the + // user) when the client was not expecting a response. + // However, in this case, we cannot close the connection + // down, since it really isn't the client's fault. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t|%N|%l) exception thrown ") + ACE_TEXT ("but client is not waiting a response\n"))); + } return result; } @@ -1005,14 +1004,14 @@ TAO_GIOP_Message_Base::process_request (TAO_Transport *transport, int TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, - TAO_InputCDR &input, - TAO_OutputCDR &output, - TAO_GIOP_Message_Generator_Parser *parser) + TAO_InputCDR &input, + TAO_OutputCDR &output, + TAO_GIOP_Message_Generator_Parser *parser) { // This will extract the request header, set <response_required> as // appropriate. TAO_GIOP_Locate_Request_Header locate_request (input, - this->orb_core_); + this->orb_core_); TAO_GIOP_Locate_Status_Msg status_info; @@ -1025,18 +1024,18 @@ TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, ACE_TRY { int parse_error = - parser->parse_locate_header (locate_request); + parser->parse_locate_header (locate_request); if (parse_error != 0) - { - ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_NO)); - } + { + ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_NO)); + } TAO_ObjectKey tmp_key (locate_request.object_key ().length (), - locate_request.object_key ().length (), - locate_request.object_key ().get_buffer (), - 0); + locate_request.object_key ().length (), + locate_request.object_key ().get_buffer (), + 0); // Set it to an error state parse_error = 1; @@ -1046,64 +1045,64 @@ TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, // the reply CORBA::Boolean deferred_reply = 1; TAO_ServerRequest server_request (this, - req_id, - response_required, - deferred_reply, - tmp_key, - "_non_existent", - output, - transport, - this->orb_core_, - parse_error); + req_id, + response_required, + deferred_reply, + tmp_key, + "_non_existent", + output, + transport, + this->orb_core_, + parse_error); if (parse_error != 0) - { - ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_NO)); - } + { + ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_NO)); + } CORBA::Object_var forward_to; this->orb_core_->request_dispatcher ()->dispatch ( - this->orb_core_, - server_request, - forward_to - ACE_ENV_ARG_PARAMETER); + this->orb_core_, + server_request, + forward_to + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (!CORBA::is_nil (forward_to.in ())) - { - status_info.status = TAO_GIOP_OBJECT_FORWARD; - status_info.forward_location_var = forward_to; - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("handle_locate has been called: forwarding\n"))); - } + { + status_info.status = TAO_GIOP_OBJECT_FORWARD; + status_info.forward_location_var = forward_to; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("handle_locate has been called: forwarding\n"))); + } else if (server_request.exception_type () == TAO_GIOP_NO_EXCEPTION) - { - // We got no exception, so the object is here. - status_info.status = TAO_GIOP_OBJECT_HERE; - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO: (%P|%t) handle_locate() : found\n"))); - } + { + // We got no exception, so the object is here. + status_info.status = TAO_GIOP_OBJECT_HERE; + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO: (%P|%t) handle_locate() : found\n"))); + } else - { - status_info.forward_location_var = server_request.forward_location (); - - if (!CORBA::is_nil (status_info.forward_location_var.in ())) - { - status_info.status = TAO_GIOP_OBJECT_FORWARD; - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("handle_locate has been called: forwarding\n"))); - } - else - { - // Normal exception, so the object is not here - status_info.status = TAO_GIOP_UNKNOWN_OBJECT; - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("handle_locate has been called: not here\n"))); - } - } + { + status_info.forward_location_var = server_request.forward_location (); + + if (!CORBA::is_nil (status_info.forward_location_var.in ())) + { + status_info.status = TAO_GIOP_OBJECT_FORWARD; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("handle_locate has been called: forwarding\n"))); + } + else + { + // Normal exception, so the object is not here + status_info.status = TAO_GIOP_UNKNOWN_OBJECT; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("handle_locate has been called: not here\n"))); + } + } } ACE_CATCHANY @@ -1111,9 +1110,9 @@ TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, // Normal exception, so the object is not here status_info.status = TAO_GIOP_UNKNOWN_OBJECT; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) TAO_GIOP_Message_Base::process_locate_request - ") - ACE_TEXT ("CORBA exception raised\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) TAO_GIOP_Message_Base::process_locate_request - ") + ACE_TEXT ("CORBA exception raised\n"))); } #if defined (TAO_HAS_EXCEPTIONS) ACE_CATCHALL @@ -1121,37 +1120,37 @@ TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, // Normal exception, so the object is not here status_info.status = TAO_GIOP_UNKNOWN_OBJECT; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) TAO_GIOP_Message_Base::process_locate_request - ") - ACE_TEXT ("C++ exception raised\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) TAO_GIOP_Message_Base::process_locate_request - ") + ACE_TEXT ("C++ exception raised\n"))); } #endif /* TAO_HAS_EXCEPTIONS */ ACE_ENDTRY; return this->make_send_locate_reply (transport, - locate_request, - status_info, - output, - parser); + locate_request, + status_info, + output, + parser); } int TAO_GIOP_Message_Base::make_send_locate_reply (TAO_Transport *transport, - TAO_GIOP_Locate_Request_Header &request, - TAO_GIOP_Locate_Status_Msg &status_info, - TAO_OutputCDR &output, - TAO_GIOP_Message_Generator_Parser *parser) + TAO_GIOP_Locate_Request_Header &request, + TAO_GIOP_Locate_Status_Msg &status_info, + TAO_OutputCDR &output, + TAO_GIOP_Message_Generator_Parser *parser) { // Note here we are making the Locate reply header which is *QUITE* // different from the reply header made by the make_reply () call.. // Make the GIOP message header this->write_protocol_header (TAO_GIOP_LOCATEREPLY, - output); + output); // This writes the header & body parser->write_locate_reply_mesg (output, - request.request_id (), - status_info); + request.request_id (), + status_info); // Send the message int result = transport->send_message (output); @@ -1160,11 +1159,11 @@ TAO_GIOP_Message_Base::make_send_locate_reply (TAO_Transport *transport, if (result == -1) { if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO: (%P|%t) %p: cannot send reply\n"), - ACE_TEXT ("TAO_GIOP_Message_Base::make_send_locate_reply"))); - } + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO: (%P|%t) %p: cannot send reply\n"), + ACE_TEXT ("TAO_GIOP_Message_Base::make_send_locate_reply"))); + } } return result; @@ -1195,21 +1194,21 @@ TAO_GIOP_Message_Base::send_error (TAO_Transport *transport) }; // @@ Q: How does this works with GIOP lite? - // A: It doesn't + // A: It doesn't this->dump_msg ("send_error", - (const u_char *) error_message, - TAO_GIOP_MESSAGE_HEADER_LEN); + (const u_char *) error_message, + TAO_GIOP_MESSAGE_HEADER_LEN); ACE_Data_Block data_block (TAO_GIOP_MESSAGE_HEADER_LEN, - ACE_Message_Block::MB_DATA, - error_message, - 0, - 0, - ACE_Message_Block::DONT_DELETE, - 0); + ACE_Message_Block::MB_DATA, + error_message, + 0, + 0, + ACE_Message_Block::DONT_DELETE, + 0); ACE_Message_Block message_block(&data_block, - ACE_Message_Block::DONT_DELETE); + ACE_Message_Block::DONT_DELETE); message_block.wr_ptr (TAO_GIOP_MESSAGE_HEADER_LEN); size_t bt; @@ -1217,9 +1216,9 @@ TAO_GIOP_Message_Base::send_error (TAO_Transport *transport) if (result == -1) { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%N|%l|%P|%t) error sending error to transport %lu\n"), - transport->id ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%N|%l|%P|%t) error sending error to transport %lu\n"), + transport->id ())); } return result; @@ -1235,22 +1234,22 @@ TAO_GIOP_Message_Base::set_state ( { case 1: switch (def_minor) - { - case 0: - gen_parser = - &this->tao_giop_impl_.tao_giop_10; - break; - case 1: - gen_parser = - &this->tao_giop_impl_.tao_giop_11; - break; - case 2: - gen_parser = - &this->tao_giop_impl_.tao_giop_12; - break; - default: - break; - } + { + case 0: + gen_parser = + &this->tao_giop_impl_.tao_giop_10; + break; + case 1: + gen_parser = + &this->tao_giop_impl_.tao_giop_11; + break; + case 2: + gen_parser = + &this->tao_giop_impl_.tao_giop_12; + break; + default: + break; + } break; default: break; @@ -1264,7 +1263,7 @@ TAO_GIOP_Message_Base::set_state ( // // NOTE: this is IIOP-specific though it doesn't look like it is. It // relies on a TCP-ism: orderly disconnect, which doesn't exist in all -// transport protocols. Versions of GIOP atop some transport that's +// transport protocols. Versions of GIOP atop some transport that's // lacking orderly disconnect must define some transport-specific // handshaking (e.g. the XNS/SPP handshake convention) in order to // know that the same transport semantics are provided when shutdown @@ -1276,8 +1275,8 @@ TAO_GIOP_Message_Base::set_state ( void TAO_GIOP_Message_Base:: send_close_connection (const TAO_GIOP_Message_Version &version, - TAO_Transport *transport, - void *) + TAO_Transport *transport, + void *) { // static CORBA::Octet @@ -1305,14 +1304,14 @@ TAO_GIOP_Message_Base:: // that this won't block (long) since we never set SO_LINGER this->dump_msg ("send_close_connection", - (const u_char *) close_message, - TAO_GIOP_MESSAGE_HEADER_LEN); + (const u_char *) close_message, + TAO_GIOP_MESSAGE_HEADER_LEN); #if 0 // @@CJC I don't think we need this check b/c the transport's send() // will simply return -1. However, I guess we could create something // like TAO_Tranport::is_closed() that returns whether the connection - // is already closed. The problem with that, however, is that it's + // is already closed. The problem with that, however, is that it's // entirely possible that is_closed() could return TRUE, and then the // transport could get closed down btw. the time it gets called and the // time that the send actually occurs. @@ -1320,20 +1319,20 @@ TAO_GIOP_Message_Base:: if (which == ACE_INVALID_HANDLE) { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) TAO_GIOP_Message_Base::send_close_connection -" - " connection already closed\n")); + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) TAO_GIOP_Message_Base::send_close_connection -" + " connection already closed\n")); return; } #endif ACE_Data_Block data_block (TAO_GIOP_MESSAGE_HEADER_LEN, - ACE_Message_Block::MB_DATA, - close_message, - 0, - 0, - ACE_Message_Block::DONT_DELETE, - 0); + ACE_Message_Block::MB_DATA, + close_message, + 0, + 0, + ACE_Message_Block::DONT_DELETE, + 0); ACE_Message_Block message_block(&data_block); message_block.wr_ptr (TAO_GIOP_MESSAGE_HEADER_LEN); @@ -1342,15 +1341,15 @@ TAO_GIOP_Message_Base:: if (result == -1) { if (TAO_debug_level > 0) - ACE_ERROR ((LM_ERROR, - "(%P|%t) error closing connection %lu, errno = %d\n", - transport->id (), errno)); + ACE_ERROR ((LM_ERROR, + "(%P|%t) error closing connection %lu, errno = %d\n", + transport->id (), errno)); } transport->close_connection (); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) shut down transport, handle %d\n", - transport-> id ())); + "(%P|%t) shut down transport, handle %d\n", + transport-> id ())); } @@ -1368,20 +1367,20 @@ TAO_GIOP_Message_Base::send_reply_exception ( char repbuf[ACE_CDR::DEFAULT_BUFSIZE]; #if defined(ACE_HAS_PURIFY) (void) ACE_OS::memset (repbuf, - '\0', - sizeof repbuf); + '\0', + sizeof repbuf); #endif /* ACE_HAS_PURIFY */ TAO_OutputCDR output (repbuf, - sizeof repbuf, - TAO_ENCAP_BYTE_ORDER, - orb_core->output_cdr_buffer_allocator (), - orb_core->output_cdr_dblock_allocator (), - orb_core->output_cdr_msgblock_allocator (), - orb_core->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - orb_core->to_iso8859 (), - orb_core->to_unicode ()); + sizeof repbuf, + TAO_ENCAP_BYTE_ORDER, + orb_core->output_cdr_buffer_allocator (), + orb_core->output_cdr_dblock_allocator (), + orb_core->output_cdr_msgblock_allocator (), + orb_core->orb_params ()->cdr_memcpy_tradeoff (), + TAO_DEF_GIOP_MAJOR, + TAO_DEF_GIOP_MINOR, + orb_core->to_iso8859 (), + orb_core->to_unicode ()); TAO_Pluggable_Reply_Params_Base reply_params; reply_params.request_id_ = request_id; @@ -1390,7 +1389,7 @@ TAO_GIOP_Message_Base::send_reply_exception ( // We are going to send some data reply_params.argument_flag_ = 1; - // Send back the service context we received. (RTCORBA relies on + // Send back the service context we received. (RTCORBA relies on // this). reply_params.service_context_notowned (svc_info); @@ -1402,8 +1401,8 @@ TAO_GIOP_Message_Base::send_reply_exception ( } if (this->generate_exception_reply (output, - reply_params, - *x) == -1) + reply_params, + *x) == -1) return -1; return transport->send_message (output); @@ -1411,8 +1410,8 @@ TAO_GIOP_Message_Base::send_reply_exception ( void TAO_GIOP_Message_Base::dump_msg (const char *label, - const u_char *ptr, - size_t len) + const u_char *ptr, + size_t len) { if (TAO_debug_level >= 5) @@ -1420,21 +1419,21 @@ TAO_GIOP_Message_Base::dump_msg (const char *label, static const char digits[] = "0123456789ABCD"; static const char *names[] = { - "Request", - "Reply", - "CancelRequest", - "LocateRequest", - "LocateReply", - "CloseConnection", - "MessageError", - "Fragment" + "Request", + "Reply", + "CancelRequest", + "LocateRequest", + "LocateReply", + "CloseConnection", + "MessageError", + "Fragment" }; // Message name. const char *message_name = "UNKNOWN MESSAGE"; u_long slot = ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET]; if (slot < sizeof (names) / sizeof (names[0])) - message_name = names[slot]; + message_name = names[slot]; // Byte order. int byte_order = ptr[TAO_GIOP_MESSAGE_FLAGS_OFFSET] & 0x01; @@ -1448,39 +1447,39 @@ TAO_GIOP_Message_Base::dump_msg (const char *label, CORBA::ULong *id = &tmp; if (ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REQUEST || - ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REPLY) - { - // @@ Only works if ServiceContextList is empty.... - if (minor < 2) - { - id = ACE_reinterpret_cast (CORBA::ULong *, - (char * ) (ptr + TAO_GIOP_MESSAGE_HEADER_LEN + 4)); - - } - else - { - id = ACE_reinterpret_cast (CORBA::ULong *, - (char * ) (ptr + TAO_GIOP_MESSAGE_HEADER_LEN)); - } - } + ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REPLY) + { + // @@ Only works if ServiceContextList is empty.... + if (minor < 2) + { + id = ACE_reinterpret_cast (CORBA::ULong *, + (char * ) (ptr + TAO_GIOP_MESSAGE_HEADER_LEN + 4)); + + } + else + { + id = ACE_reinterpret_cast (CORBA::ULong *, + (char * ) (ptr + TAO_GIOP_MESSAGE_HEADER_LEN)); + } + } // Print. ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P | %t): %s GIOP v%c.%c msg, ") - ACE_TEXT ("%d data bytes, %s endian, %s = %u\n"), + ACE_TEXT ("(%P | %t): %s GIOP v%c.%c msg, ") + ACE_TEXT ("%d data bytes, %s endian, %s = %u\n"), ACE_TEXT_CHAR_TO_TCHAR(label), - digits[ptr[TAO_GIOP_VERSION_MAJOR_OFFSET]], - digits[ptr[TAO_GIOP_VERSION_MINOR_OFFSET]], - len - TAO_GIOP_MESSAGE_HEADER_LEN , + digits[ptr[TAO_GIOP_VERSION_MAJOR_OFFSET]], + digits[ptr[TAO_GIOP_VERSION_MINOR_OFFSET]], + len - TAO_GIOP_MESSAGE_HEADER_LEN , (byte_order == TAO_ENCAP_BYTE_ORDER) ? ACE_LIB_TEXT("my") : ACE_LIB_TEXT("other"), ACE_TEXT_CHAR_TO_TCHAR(message_name), *id)); if (TAO_debug_level >= 10) - ACE_HEX_DUMP ((LM_DEBUG, - (const char *) ptr, - len, - ACE_TEXT ("GIOP message"))); + ACE_HEX_DUMP ((LM_DEBUG, + (const char *) ptr, + len, + ACE_TEXT ("GIOP message"))); } } @@ -1504,8 +1503,8 @@ TAO_GIOP_Message_Base::is_ready_for_bidirectional (TAO_OutputCDR &msg) // Get the state information that we need to use this->set_state (major, - minor, - parser); + minor, + parser); // We dont really know.. So ask the generator and parser objects that // we know. @@ -1531,14 +1530,14 @@ TAO_GIOP_Message_Base::make_queued_data (size_t sz) // allocate ACE_CDR::MAX_ALIGNMENT extra. ACE_Data_Block *db = this->orb_core_->data_block_for_message_block (sz + - ACE_CDR::MAX_ALIGNMENT); + ACE_CDR::MAX_ALIGNMENT); ACE_Allocator *alloc = this->orb_core_->message_block_msgblock_allocator (); ACE_Message_Block mb (db, - 0, - alloc); + 0, + alloc); ACE_Message_Block *new_mb = mb.duplicate (); |