summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2002-11-11 20:31:48 +0000
committerbala <balanatarajan@users.noreply.github.com>2002-11-11 20:31:48 +0000
commite141fc7c40288e0972f9241fddf09b5b69c78925 (patch)
tree6ed2d3c574cdbe34fd6e36c6bbfd6fe3a820343f
parent056957474ea5d182d59b050a4d6b6b2fece99f69 (diff)
downloadATCD-e141fc7c40288e0972f9241fddf09b5b69c78925.tar.gz
ChangeLogTag: Mon Nov 11 14:28:39 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
-rw-r--r--TAO/ChangeLog12
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp31
2 files changed, 32 insertions, 11 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index bf66bb5556c..2045b909b31 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,15 @@
+Mon Nov 11 14:28:39 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
+
+ * tao/GIOP_Message_Base.cpp (consolidate_fragments): When growing
+ the message block to increase the allocated memory, we now use
+ the length () of the available message block as the basis for
+ growing instead of the size (). Simon McQueen of PrismTech ran
+ several experiments while investigating problems related to
+ [BUGID 1356] and is convinced this is the right way to go, since
+ this uses less memory. Since I dont foresee problems, his patch
+ is being accepted for the release. Thanks to Simon for putting
+ in lot of effort to narrow down the problem to this area.
+
Mon Nov 11 10:43:59 2002 Nanbor Wang <nanbor@cs.wustl.edu>
* orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.dsp:
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 484f08de52f..9ac3f504ed7 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -425,13 +425,16 @@ TAO_GIOP_Message_Base::consolidate_node (TAO_Queued_Data *qd,
// Now grow the message block so that we can copy the rest of
// the data...
- ACE_CDR::grow (qd->msg_block_,
- state.message_size ());
+ if (qd->msg_block_->space () < state.message_size ())
+ {
+ ACE_CDR::grow (qd->msg_block_,
+ 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 the data that needs to be copied is more than that is
// available to us ..
@@ -518,18 +521,24 @@ TAO_GIOP_Message_Base::consolidate_fragments (TAO_Queued_Data *dqd,
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 ();
+ size_t incoming_length =
+ sqd->msg_block_->length ();
- // Increase the size of the destination message block
- ACE_Message_Block *mb = dqd->msg_block_;
+ // Increase the size of the destination message block if we need
+ // to.
+ ACE_Message_Block *mb =
+ dqd->msg_block_;
- ACE_CDR::grow (mb,
- mb->size () + incoming_size);
+ // Check space before growing.
+ if (mb->space () < incoming_length)
+ {
+ ACE_CDR::grow (mb,
+ mb->length () + incoming_length);
+ }
// Copy the data
dqd->msg_block_->copy (sqd->msg_block_->rd_ptr (),
- incoming_size);
-
+ incoming_length);
return 0;
}