summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Base.cpp
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-07-17 00:42:56 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-07-17 00:42:56 +0000
commit8ffc834b5ff7d9169f462db009f2286606e4cfce (patch)
treeff61f3e3f109693e192682617a74e76ca5cfab6e /TAO/tao/GIOP_Message_Base.cpp
parentcb39d12e7aef10ba13466fc2579bd865ddbfd465 (diff)
downloadATCD-8ffc834b5ff7d9169f462db009f2286606e4cfce.tar.gz
*** empty log message ***giop_lite_fragment
Diffstat (limited to 'TAO/tao/GIOP_Message_Base.cpp')
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp50
1 files changed, 46 insertions, 4 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 28b43bec158..faa68f3cf16 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -46,7 +46,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 +254,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 +390,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 +452,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 +499,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_);