diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-04-16 03:24:20 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-04-16 03:24:20 +0000 |
commit | 12ea449365d25f2be70fc2559126f0ac06d5ff74 (patch) | |
tree | ae3e5bcb615d956b92a2af67083928b435a56de3 /TAO/tao/Incoming_Message_Queue.cpp | |
parent | e630537f6d59a3fca512b1f29481d2862a5ed6e8 (diff) | |
download | ATCD-12ea449365d25f2be70fc2559126f0ac06d5ff74.tar.gz |
ChangeLogTag: Mon Apr 15 22:19:31 2002 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Incoming_Message_Queue.cpp')
-rw-r--r-- | TAO/tao/Incoming_Message_Queue.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/TAO/tao/Incoming_Message_Queue.cpp b/TAO/tao/Incoming_Message_Queue.cpp index 737e329ea7b..4f825485ba2 100644 --- a/TAO/tao/Incoming_Message_Queue.cpp +++ b/TAO/tao/Incoming_Message_Queue.cpp @@ -163,3 +163,29 @@ TAO_Queued_Data::TAO_Queued_Data (const TAO_Queued_Data &qd) next_ (0) { } + + +/*static*/ void +TAO_Queued_Data::replace_data_block (ACE_Message_Block &mb) +{ + size_t newsize = + ACE_CDR::total_length (&mb, 0) + ACE_CDR::MAX_ALIGNMENT; + + ACE_Data_Block *db = + mb.data_block ()->clone_nocopy (); + + if (db->size (newsize) == -1) + return; + + ACE_Message_Block tmp (db); + ACE_CDR::mb_align (&tmp); + + tmp.copy (mb.rd_ptr (), mb.length()); + mb.data_block (tmp.data_block ()->duplicate ()); + + mb.rd_ptr (tmp.rd_ptr ()); + mb.wr_ptr (tmp.wr_ptr ()); + + // Remove the DONT_DELETE flags from mb + mb.clr_self_flags (ACE_Message_Block::DONT_DELETE); +} |