summaryrefslogtreecommitdiff
path: root/TAO/tao/Reply_Dispatcher.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-17 01:23:36 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-17 01:23:36 +0000
commit32d9fda25754d6e8e0e0ccaa47f0be3d73dbed49 (patch)
tree56c3b4dd9d912532c9b90b6ebb5c932e1318d632 /TAO/tao/Reply_Dispatcher.cpp
parente65acb631bc11044fbc868c4b9e8ba11ec9bbca1 (diff)
downloadATCD-32d9fda25754d6e8e0e0ccaa47f0be3d73dbed49.tar.gz
ChangeLogTag:Mon Aug 16 20:16:35 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Reply_Dispatcher.cpp')
-rw-r--r--TAO/tao/Reply_Dispatcher.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp
index 1ecb5c3782c..98e851ee961 100644
--- a/TAO/tao/Reply_Dispatcher.cpp
+++ b/TAO/tao/Reply_Dispatcher.cpp
@@ -21,7 +21,7 @@ TAO_Reply_Dispatcher::~TAO_Reply_Dispatcher (void)
}
TAO_GIOP_Message_State *
-TAO_Reply_Dispatcher::message_state (void) const
+TAO_Reply_Dispatcher::message_state (void)
{
return 0;
}
@@ -37,10 +37,7 @@ TAO_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *)
// Constructor.
TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core)
- : message_state_ (0),
- reply_cdr_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
- TAO_ENCAP_BYTE_ORDER,
- orb_core),
+ : message_state_ (orb_core),
reply_received_ (0),
leader_follower_condition_variable_ (0),
orb_core_ (orb_core)
@@ -63,7 +60,6 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
this->reply_status_ = reply_status;
this->version_ = version;
- this->message_state_ = message_state;
// Steal the buffer, that way we don't do any unnecesary copies of
// this data.
@@ -72,8 +68,17 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
IOP::ServiceContext* context_list = reply_ctx.get_buffer (1);
this->reply_service_info_.replace (max, len, context_list, 1);
- // Steal the buffer so that no copying is done.
- this->reply_cdr_.steal_from (message_state->cdr);
+ if (&this->message_state_ != message_state)
+ {
+ // The Transport Mux Strategy did not use our Message_State to
+ // receive the event, possibly because it is muxing multiple
+ // requests over the same connection.
+
+ // Steal the buffer so that no copying is done.
+ this->message_state_.cdr.steal_from (message_state->cdr);
+
+ // There is no need to copy the other fields!
+ }
// If condition variable is present, then we are doing leader
// follower model. Do all the nessary things.
@@ -98,21 +103,21 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
}
TAO_GIOP_Message_State *
-TAO_Synch_Reply_Dispatcher::message_state (void) const
+TAO_Synch_Reply_Dispatcher::message_state (void)
{
- return this->message_state_;
+ return &this->message_state_;
}
TAO_InputCDR &
TAO_Synch_Reply_Dispatcher::reply_cdr (void)
{
- return this->reply_cdr_;
+ return this->message_state_.cdr;
}
int &
TAO_Synch_Reply_Dispatcher::reply_received (void)
{
- return reply_received_;
+ return this->reply_received_;
}
int
@@ -188,8 +193,9 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status,
}
TAO_GIOP_Message_State *
-TAO_Asynch_Reply_Dispatcher::message_state (void) const
+TAO_Asynch_Reply_Dispatcher::message_state (void)
{
return this->message_state_;
}
+
#endif /* TAO_HAS_CORBA_MESSAGING && TAO_POLLER */