summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-08-11 22:06:17 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-08-11 22:06:17 +0000
commit2ef1879f871c7d2583f927270570bc0f3012059c (patch)
treede2216e5efebf2882b519d6535457f97785688e6
parentfcab4b8ad682213486dbab68f69fdd39cbbcdae8 (diff)
downloadATCD-2ef1879f871c7d2583f927270570bc0f3012059c.tar.gz
ChangeLogTag: Sat Aug 11 17:02:44 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a11
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp16
-rw-r--r--TAO/tao/GIOP_Message_State.cpp4
-rw-r--r--TAO/tao/GIOP_Message_State.inl4
-rw-r--r--TAO/tao/Incoming_Message_Queue.inl7
-rw-r--r--TAO/tao/Transport.cpp31
6 files changed, 55 insertions, 18 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 89be5f7f54a..28db2b9a30c 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,14 @@
+Sat Aug 11 17:02:44 2001 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * tao/GIOP_Message_Base.cpp:
+ * tao/GIOP_Message_State.cpp:
+ * tao/GIOP_Message_State.inl:
+ * tao/Incoming_Message_Queue.inl:
+ * tao/Transport.cpp: A chance for us to test the fragmentation
+ support on the server side. Fixed quite a few bugs with our
+ fragmentation support. The tests were conducted against ORBIX
+ 2K. The bugs fixed were mostly the way we handle the fragments.
+
Sat Aug 11 11:34:47 2001 Carlos O'Ryan <coryan@uci.edu>
* orbsvcs/orbsvcs/Event_Utilities.cpp (insert):
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 5c09b928ddb..054062ad1f4 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -472,14 +472,18 @@ TAO_GIOP_Message_Base::consolidate_fragments (TAO_Queued_Data *dqd,
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)
+ if (sqd->minor_version_ == 2 &&
+ sqd->msg_type_ == TAO_PLUGGABLE_MESSAGE_FRAGMENT)
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);
+ ACE_Message_Block *mb = dqd->msg_block_;
+
+ ACE_CDR::grow (mb,
+ mb->size () + incoming_size);
// Copy the data
dqd->msg_block_->copy (sqd->msg_block_->rd_ptr (),
@@ -499,9 +503,13 @@ 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->more_fragments_ = this->message_state_.more_fragments_;
+ if (this->message_state_.more_fragments_)
+ qd->more_fragments_ = 1;
+ else
+ qd->more_fragments_ = 0;
+
qd->msg_type_=
this->message_type (this->message_state_);
diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp
index 1dfe9bacf32..ad6e59361af 100644
--- a/TAO/tao/GIOP_Message_State.cpp
+++ b/TAO/tao/GIOP_Message_State.cpp
@@ -236,7 +236,9 @@ TAO_GIOP_Message_State::parse_fragment_header (char *buf,
// By this point we are doubly sure that we have a more or less
// valid GIOP message with a valid major revision number.
- if (this->giop_version_.minor == 2 && length > len)
+ if (this->giop_version_.minor == 2 &&
+ this->message_type_ == TAO_GIOP_FRAGMENT &&
+ length > len)
{
// Fragmented message in GIOP 1.2 should have a fragment header
// following the GIOP header. Grab the rd_ptr to get that
diff --git a/TAO/tao/GIOP_Message_State.inl b/TAO/tao/GIOP_Message_State.inl
index b6d2989eaa9..fe076bee689 100644
--- a/TAO/tao/GIOP_Message_State.inl
+++ b/TAO/tao/GIOP_Message_State.inl
@@ -8,10 +8,6 @@ TAO_GIOP_Message_State::message_size (void) const
CORBA::ULong len =
this->message_size_ + TAO_GIOP_MESSAGE_HEADER_LEN;
- if (this->more_fragments_ &&
- this->giop_version_.minor > 1)
- len += TAO_GIOP_MESSAGE_FRAGMENT_HEADER;
-
return len;
}
diff --git a/TAO/tao/Incoming_Message_Queue.inl b/TAO/tao/Incoming_Message_Queue.inl
index df61432d461..3f82216bed8 100644
--- a/TAO/tao/Incoming_Message_Queue.inl
+++ b/TAO/tao/Incoming_Message_Queue.inl
@@ -57,8 +57,7 @@ TAO_Incoming_Message_Queue::is_tail_complete (void)
return -1;
if (this->size_ &&
- this->queued_data_->missing_data_ == 0 &&
- this->queued_data_->more_fragments_ == 0)
+ this->queued_data_->missing_data_ == 0)
return 1;
return 0;
@@ -72,7 +71,7 @@ TAO_Incoming_Message_Queue::is_head_complete (void)
if (this->size_ &&
this->queued_data_->next_->missing_data_ == 0 &&
- this->queued_data_->more_fragments_ == 0)
+ this->queued_data_->next_->more_fragments_ == 0)
return 1;
return 0;
@@ -85,7 +84,7 @@ TAO_Incoming_Message_Queue::is_tail_fragmented (void)
return 0;
if (this->size_ &&
- this->queued_data_->more_fragments_ == 0)
+ this->queued_data_->more_fragments_ == 1)
return 1;
return 0;
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 0f47d76cbe9..8865a6edcb6 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -27,6 +27,7 @@
ACE_RCSID(tao, Transport, "$Id$")
+
TAO_Synch_Refcountable::TAO_Synch_Refcountable (ACE_Lock *lock, int refcount)
: ACE_Refcountable (refcount)
, refcount_lock_ (lock)
@@ -879,7 +880,7 @@ TAO_Transport::handle_input_i (TAO_Resume_Handle &rh,
{
// Duplicate the node that we have as the node is on stack..
TAO_Queued_Data *nqd =
- this->make_queued_data (message_block);
+ TAO_Queued_Data::duplicate (qd);
return this->consolidate_fragments (nqd, rh);
}
@@ -955,7 +956,7 @@ size_t
TAO_Transport::missing_data (ACE_Message_Block &incoming)
{
// If we have a incomplete message in the queue then find out how
- // much of data is required to get a complete message
+ // much of data is required to get a complete message.
if (this->incoming_message_queue_.is_tail_complete () == 0)
{
return this->incoming_message_queue_.missing_data_tail ();
@@ -999,6 +1000,13 @@ TAO_Transport::consolidate_message (ACE_Message_Block &incoming,
missing_data,
max_wait_time);
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Read [%d] bytes on attempt \n",
+ n));
+ }
+
// If we got an error..
if (n == -1)
{
@@ -1027,16 +1035,19 @@ TAO_Transport::consolidate_message (ACE_Message_Block &incoming,
// in the queue as they would have been taken care before. Put
// ourselves in the queue and then try processing one of the
// messages..
- if (missing_data > 0 ||
- this->incoming_message_queue_.queue_length ())
+ if ((missing_data > 0
+ ||this->incoming_message_queue_.queue_length ())
+ && this->incoming_message_queue_.is_tail_fragmented () == 0)
{
if (TAO_debug_level > 4)
{
ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Amba \n",
+ n));
+ ACE_DEBUG ((LM_DEBUG,
"TAO (%P|%t) - TAO_Transport[%d]::consolidate_message \n"
"queueing up the message \n",
this->id ()));
-
}
// Get a queued data
@@ -1100,11 +1111,13 @@ TAO_Transport::consolidate_fragments (TAO_Queued_Data *qd,
this->incoming_message_queue_.dequeue_tail ();
tqd->more_fragments_ = qd->more_fragments_;
+ tqd->missing_data_ = qd->missing_data_;
if (this->messaging_object ()->consolidate_fragments (tqd,
qd) == -1)
return -1;
+
TAO_Queued_Data::release (qd);
this->incoming_message_queue_.enqueue_tail (tqd);
@@ -1182,6 +1195,14 @@ TAO_Transport::consolidate_message_queue (ACE_Message_Block &incoming,
// Add the missing data to the queue
qd->missing_data_ = 0;
+ // Check whether the message was fragmented and try to consolidate
+ // the fragments..
+ if (qd->more_fragments_ ||
+ (qd->msg_type_ == TAO_PLUGGABLE_MESSAGE_FRAGMENT))
+ {
+ return this->consolidate_fragments (qd, rh);
+ }
+
// Add it to the tail of the queue..
this->incoming_message_queue_.enqueue_tail (qd);