summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Base.cpp
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-07-23 16:47:59 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-07-23 16:47:59 +0000
commite95324ce8e15018601299fcf10185bcbb7a8d788 (patch)
treea676e62438b1f2d1d4dd00c7492d51e1fe7dce94 /TAO/tao/GIOP_Message_Base.cpp
parent8c56bc73fd0436714b30aa99b0b7a296561edd12 (diff)
downloadATCD-e95324ce8e15018601299fcf10185bcbb7a8d788.tar.gz
ChangeLogTag: Mon Jul 23 11:44:30 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/GIOP_Message_Base.cpp')
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp52
1 files changed, 48 insertions, 4 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index c9c4fe10904..3df80faebbc 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -1,5 +1,6 @@
// $Id$
+
#include "GIOP_Message_Base.h"
#include "operation_details.h"
#include "GIOP_Utils.h"
@@ -18,6 +19,7 @@
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*/)
: orb_core_ (orb_core),
@@ -46,7 +48,7 @@ TAO_GIOP_Message_Base::init (CORBA::Octet major,
void
-TAO_GIOP_Message_Base::reset (int /* reset_flag */)
+TAO_GIOP_Message_Base::reset (void)
{
// no-op
}
@@ -254,10 +256,14 @@ TAO_GIOP_Message_Base::message_type (
case TAO_GIOP_CLOSECONNECTION:
return TAO_PLUGGABLE_MESSAGE_CLOSECONNECTION;
+ case TAO_GIOP_FRAGMENT:
+ return TAO_PLUGGABLE_MESSAGE_FRAGMENT;
+
case TAO_GIOP_CANCELREQUEST:
case TAO_GIOP_MESSAGERROR:
- case TAO_GIOP_FRAGMENT:
// Never happens: why??
+
+
default:
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t) %N:%l message_type : ")
@@ -386,8 +392,7 @@ TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd,
// Copy the pay load..
// Calculate the bytes that needs to be copied in the queue...
- size_t copy_len =
- state.message_size () - TAO_GIOP_MESSAGE_HEADER_LEN;
+ size_t copy_len = state.payload_size ();
// If teh data that needs to be copied is more than that is
// available to us ..
@@ -449,6 +454,42 @@ 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)
+{
+ if (dqd->byte_order_ != sqd->byte_order_
+ || dqd->major_version_ != sqd->major_version_
+ || dqd->minor_version_ != sqd->minor_version_)
+ {
+ // 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")));
+ return -1;
+ }
+
+ // Skip the header in the incoming message
+ sqd->msg_block_->rd_ptr (TAO_GIOP_MESSAGE_HEADER_LEN);
+
+ // If we have a fragment header skip the header length too..
+ if (sqd->minor_version_ == 2)
+ sqd->msg_block_->rd_ptr (TAO_GIOP_MESSAGE_FRAGMENT_HEADER);
+
+ // Get the length of the incoming message block..
+ int incoming_size = sqd->msg_block_->length ();
+
+ // Increase the size of the destination message block
+ dqd->msg_block_->size (incoming_size);
+
+ // Copy the data
+ dqd->msg_block_->copy (sqd->msg_block_->rd_ptr (),
+ incoming_size);
+
+ return 0;
+}
+
void
TAO_GIOP_Message_Base::get_message_data (TAO_Queued_Data *qd)
{
@@ -460,6 +501,9 @@ TAO_GIOP_Message_Base::get_message_data (TAO_Queued_Data *qd)
qd->minor_version_ =
this->message_state_.giop_version_.minor;
+ qd->more_fragments_ =
+ this->message_state_.more_fragments_;
+
qd->msg_type_=
this->message_type (this->message_state_);