summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp5
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp47
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser.cpp5
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser_10.cpp8
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser_12.cpp13
-rw-r--r--TAO/tao/GIOP_Message_Lite.cpp42
-rw-r--r--TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp5
-rw-r--r--TAO/tao/Pluggable_Messaging_Utils.cpp16
-rw-r--r--TAO/tao/Pluggable_Messaging_Utils.h16
-rw-r--r--TAO/tao/Synch_Reply_Dispatcher.cpp9
-rw-r--r--TAO/tao/Transport.cpp22
11 files changed, 95 insertions, 93 deletions
diff --git a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
index 1ef07265194..bf713b3a628 100644
--- a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
+++ b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp
@@ -49,11 +49,14 @@ TAO_DII_Deferred_Reply_Dispatcher::dispatch_reply (
TAO_Pluggable_Reply_Params &params
)
{
+ if (params.input_cdr_ == 0)
+ return -1;
+
this->reply_status_ = params.reply_status_;
// Transfer the <params.input_cdr_>'s content to this->reply_cdr_
ACE_Data_Block *db =
- this->reply_cdr_.clone_from (params.input_cdr_);
+ this->reply_cdr_.clone_from (*params.input_cdr_);
if (db == 0)
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 4a0e8bc4c4f..76aeeaee51e 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -7,6 +7,7 @@
#include "TAO_Server_Request.h"
#include "GIOP_Message_Locate_Header.h"
#include "Transport.h"
+#include "Transport_Mux_Strategy.h"
#include "LF_Strategy.h"
#include "Request_Dispatcher.h"
#include "Codeset_Manager.h"
@@ -15,8 +16,8 @@
# include "GIOP_Message_Base.i"
#endif /* __ACE_INLINE__ */
-ACE_RCSID (tao,
- GIOP_Message_Base,
+ACE_RCSID (tao,
+ GIOP_Message_Base,
"$Id$")
TAO_GIOP_Message_Base::TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core,
@@ -739,7 +740,7 @@ TAO_GIOP_Message_Base::process_reply_message (
// Create a empty buffer on stack
// NOTE: We use the same data block in which we read the message and
// we pass it on to the higher layers of the ORB. So we dont to any
- // copies at all here. The same is alos done in the higher layers.
+ // copies at all here.
TAO_InputCDR input_cdr (qd->msg_block_->data_block (),
ACE_Message_Block::DONT_DELETE,
rd_pos,
@@ -749,30 +750,52 @@ TAO_GIOP_Message_Base::process_reply_message (
qd->minor_version_,
this->orb_core_);
- // Reset the message state. Now, we are ready for the next nested
- // upcall if any.
- // this->message_handler_.reset (0);
-
// We know we have some reply message. Check whether it is a
// GIOP_REPLY or GIOP_LOCATE_REPLY to take action.
// Once we send the InputCDR stream we need to just forget about
// the stream and never touch that again for anything. We basically
// loose ownership of the data_block.
+ int retval = 0;
switch (qd->msg_type_)
{
case TAO_PLUGGABLE_MESSAGE_REPLY:
// Should be taken care by the state specific parsing
- return generator_parser->parse_reply (input_cdr,
- params);
+ retval =
+ generator_parser->parse_reply (input_cdr,
+ params);
+ break;
case TAO_PLUGGABLE_MESSAGE_LOCATEREPLY:
- return generator_parser->parse_locate_reply (input_cdr,
- params);
+ retval =
+ generator_parser->parse_locate_reply (input_cdr,
+ params);
+ break;
default:
- return -1;
+ retval = -1;
}
+
+ if (retval == -1)
+ return retval;
+
+ params.input_cdr_ = &input_cdr;
+
+ retval =
+ params.transport_->tms ()->dispatch_reply (params);
+
+ if (retval == -1)
+ {
+ // Something really critical happened, we will forget about
+ // every reply on this connection.
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - GIOP_Message_Base[%d]::process_parsed_messages, "
+ "dispatch reply failed\n",
+ params.transport_->id ()));
+ }
+
+ return retval;
}
int
diff --git a/TAO/tao/GIOP_Message_Generator_Parser.cpp b/TAO/tao/GIOP_Message_Generator_Parser.cpp
index f7cad45ccc5..37c2497f9db 100644
--- a/TAO/tao/GIOP_Message_Generator_Parser.cpp
+++ b/TAO/tao/GIOP_Message_Generator_Parser.cpp
@@ -2,15 +2,14 @@
#include "tao/Pluggable_Messaging_Utils.h"
#include "tao/GIOP_Utils.h"
#include "tao/debug.h"
-
#include "ace/Log_Msg.h"
#if !defined (__ACE_INLINE__)
# include "tao/GIOP_Message_Generator_Parser.inl"
#endif /* __ACE_INLINE__ */
-ACE_RCSID (tao,
- GIOP_Message_Gen_Parser,
+ACE_RCSID (tao,
+ GIOP_Message_Gen_Parser,
"$Id$")
int
diff --git a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
index a5e6fc9ad10..414f38da0c9 100644
--- a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
+++ b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp
@@ -418,10 +418,6 @@ TAO_GIOP_Message_Generator_Parser_10::parse_reply (
params) == -1)
return -1;
- // Steal rest of the contents in to the reply params and loose
- // ownership of the data block.
- params.input_cdr_.exchange_data_blocks (cdr);
-
return 0;
}
@@ -437,10 +433,6 @@ TAO_GIOP_Message_Generator_Parser_10::parse_locate_reply (
return -1;
- // Steal the contents in to the reply CDR and loose ownership of the
- // data block.
- params.input_cdr_.exchange_data_blocks (cdr);
-
return 0;
}
diff --git a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp
index 8ab8a468e1d..fb83f49e386 100644
--- a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp
+++ b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp
@@ -366,7 +366,7 @@ TAO_GIOP_Message_Generator_Parser_12::parse_reply (
if ((cdr >> params.svc_ctx_) == 0)
{
- if (TAO_debug_level > 0)
+ // if (TAO_debug_level > 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t) parse_reply, ")
ACE_TEXT ("extracting context\n")));
@@ -380,13 +380,6 @@ TAO_GIOP_Message_Generator_Parser_12::parse_reply (
cdr.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
}
-
-
-
- // Steal the contents in to the reply CDR and loose ownership of the
- // data block.
- params.input_cdr_.exchange_data_blocks (cdr);
-
return 0;
}
@@ -411,10 +404,6 @@ TAO_GIOP_Message_Generator_Parser_12::parse_locate_reply (
cdr.align_read_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR);
}*/
- // Steal the contents in to the reply CDR and loose ownership of the
- // data block.
- params.input_cdr_.exchange_data_blocks (cdr);
-
return 0;
}
diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp
index ea5d8a47e13..462266dd9bf 100644
--- a/TAO/tao/GIOP_Message_Lite.cpp
+++ b/TAO/tao/GIOP_Message_Lite.cpp
@@ -2,16 +2,17 @@
//
//$Id$
-#include "tao/GIOP_Message_Lite.h"
-#include "tao/debug.h"
-#include "tao/TAOC.h"
-#include "tao/ORB_Core.h"
-#include "tao/operation_details.h"
-#include "tao/TAO_Server_Request.h"
-#include "tao/GIOP_Message_Locate_Header.h"
-#include "tao/LF_Strategy.h"
-#include "tao/Transport.h"
-#include "tao/Codeset_Manager.h"
+#include "GIOP_Message_Lite.h"
+#include "debug.h"
+#include "TAOC.h"
+#include "ORB_Core.h"
+#include "operation_details.h"
+#include "TAO_Server_Request.h"
+#include "GIOP_Message_Locate_Header.h"
+#include "LF_Strategy.h"
+#include "Transport.h"
+#include "Transport_Mux_Strategy.h"
+#include "Codeset_Manager.h"
#if !defined (__ACE_INLINE__)
# include "tao/GIOP_Message_Lite.i"
@@ -750,7 +751,7 @@ TAO_GIOP_Message_Lite::process_request (TAO_Transport *transport,
if (!CORBA::is_nil (forward_to.in ()))
{
// We should forward to another object...
- TAO_Pluggable_Reply_Params reply_params (this->orb_core_);
+ TAO_Pluggable_Reply_Params reply_params (transport);
reply_params.request_id_ = request_id;
reply_params.reply_status_ = TAO_GIOP_LOCATION_FORWARD;
reply_params.svc_ctx_.length (0);
@@ -1130,9 +1131,20 @@ TAO_GIOP_Message_Lite::parse_reply (TAO_InputCDR &cdr,
}
}
- // Steal the contents in to the reply CDR and loose ownership of the
- // data block.
- params.input_cdr_.exchange_data_blocks (cdr);
+ params.input_cdr_= &cdr;
+
+ if ( params.transport_->tms ()->dispatch_reply (params) == -1)
+ {
+ // Something really critical happened, we will forget about
+ // every reply on this connection.
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - GIOP_Message_Lite[%d]::process_parsed_messages, "
+ "dispatch reply failed\n",
+ params.transport_->id ()));
+
+ return -1;
+ }
return 0;
}
@@ -1420,7 +1432,7 @@ TAO_GIOP_Message_Lite::send_reply_exception (
transport->assign_translators(0,&output);
// Make the GIOP & reply header. They are version specific.
- TAO_Pluggable_Reply_Params reply_params (orb_core);
+ TAO_Pluggable_Reply_Params reply_params (transport);
reply_params.request_id_ = request_id;
reply_params.svc_ctx_.length (0);
diff --git a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp
index 6150142a87b..786ad3d90c8 100644
--- a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp
+++ b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp
@@ -39,6 +39,9 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (
TAO_Pluggable_Reply_Params &params
)
{
+ if (params.input_cdr_ == 0)
+ return -1;
+
// AMI Timeout Handling Begin
timeout_handler_.cancel ();
@@ -48,7 +51,7 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (
// Transfer the <params.input_cdr_>'s content to this->reply_cdr_
ACE_Data_Block *db =
- this->reply_cdr_.clone_from (params.input_cdr_);
+ this->reply_cdr_.clone_from (*params.input_cdr_);
if (db == 0)
{
diff --git a/TAO/tao/Pluggable_Messaging_Utils.cpp b/TAO/tao/Pluggable_Messaging_Utils.cpp
index f4ab4646cc0..d7f79cecec5 100644
--- a/TAO/tao/Pluggable_Messaging_Utils.cpp
+++ b/TAO/tao/Pluggable_Messaging_Utils.cpp
@@ -7,21 +7,15 @@
#include "tao/Pluggable_Messaging_Utils.i"
#endif /* __ACE_INLINE__ */
-ACE_RCSID (tao,
- Pluggable_Messaging_Utils,
+ACE_RCSID (tao,
+ Pluggable_Messaging_Utils,
"$Id$")
TAO_Pluggable_Reply_Params::TAO_Pluggable_Reply_Params (
- TAO_ORB_Core *orb_core
+ TAO_Transport *t
)
- : input_cdr_ (orb_core->create_input_cdr_data_block (
- ACE_CDR::DEFAULT_BUFSIZE
- ),
- 0,
- TAO_ENCAP_BYTE_ORDER,
- TAO_DEF_GIOP_MAJOR,
- TAO_DEF_GIOP_MINOR,
- orb_core)
+ : input_cdr_ (0)
+ , transport_ (t)
{
}
diff --git a/TAO/tao/Pluggable_Messaging_Utils.h b/TAO/tao/Pluggable_Messaging_Utils.h
index 193d8c70753..d85c44770bd 100644
--- a/TAO/tao/Pluggable_Messaging_Utils.h
+++ b/TAO/tao/Pluggable_Messaging_Utils.h
@@ -8,7 +8,6 @@
*
* Utility classes for the TAO pluggable messaging framework.
*
- *
* @author Balachandran Natarajan <bala@cs.wustl.edu>
*/
//=============================================================================
@@ -25,6 +24,9 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_Transport;
+
/**
* @class TAO_Pluggable_Reply_Params_Base
*
@@ -88,23 +90,19 @@ protected:
*
* @brief TAO_Pluggable_Connector_Params
*
- * This represents a set of data that would be received by the
- * connector from the acceptor.
*/
class TAO_Export TAO_Pluggable_Reply_Params
: public TAO_Pluggable_Reply_Params_Base
{
public:
/// Constructor.
- TAO_Pluggable_Reply_Params (TAO_ORB_Core *orb_core);
-
- /* @todo: There is a way out clear this off from stack. Need to look
- into that after 1.2
- */
+ TAO_Pluggable_Reply_Params (TAO_Transport *t);
/// The stream with the non-demarshaled reply. This stream will be
/// passed up to the stubs to demarshal the parameter values.
- TAO_InputCDR input_cdr_;
+ TAO_InputCDR *input_cdr_;
+
+ TAO_Transport *transport_;
};
// @@ Bala: this is a GIOPism too, there is no such thing as locate
diff --git a/TAO/tao/Synch_Reply_Dispatcher.cpp b/TAO/tao/Synch_Reply_Dispatcher.cpp
index 47b0b31cc70..1233fdcd3cf 100644
--- a/TAO/tao/Synch_Reply_Dispatcher.cpp
+++ b/TAO/tao/Synch_Reply_Dispatcher.cpp
@@ -49,6 +49,13 @@ int
TAO_Synch_Reply_Dispatcher::dispatch_reply (
TAO_Pluggable_Reply_Params &params)
{
+ if (params.input_cdr_ == 0)
+ return -1;
+
+ if (TAO_debug_level > 2)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - Synch_Reply_Dispatcher::dispatch_reply ",
+ "going on \n"));
this->reply_status_ = params.reply_status_;
// Steal the buffer, that way we don't do any unnecesary copies of
@@ -64,7 +71,7 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (
// Transfer the <params.input_cdr_>'s content to this->reply_cdr_
ACE_Data_Block *db =
- this->reply_cdr_.clone_from (params.input_cdr_);
+ this->reply_cdr_.clone_from (*params.input_cdr_);
if (db == 0)
{
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 59885f09ef4..9923ff1f895 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -1762,7 +1762,7 @@ TAO_Transport::process_parsed_messages (TAO_Queued_Data *qd,
// Get the <message_type> that we have received
TAO_Pluggable_Message_Type t = qd->msg_type_;
- int result = 0;
+ // int result = 0;
if (t == TAO_PLUGGABLE_MESSAGE_CLOSECONNECTION)
{
@@ -1797,10 +1797,7 @@ TAO_Transport::process_parsed_messages (TAO_Queued_Data *qd,
{
rh.resume_handle ();
- // @@todo: Maybe the input_cdr can be constructed from the
- // message_block
- TAO_Pluggable_Reply_Params params (this->orb_core ());
-
+ TAO_Pluggable_Reply_Params params (this);
if (this->messaging_object ()->process_reply_message (params,
qd) == -1)
@@ -1814,21 +1811,6 @@ TAO_Transport::process_parsed_messages (TAO_Queued_Data *qd,
return -1;
}
- result = this->tms ()->dispatch_reply (params);
-
- if (result == -1)
- {
- // Something really critical happened, we will forget about
- // every reply on this connection.
- if (TAO_debug_level > 0)
- ACE_ERROR ((LM_ERROR,
- "TAO (%P|%t) - Transport[%d]::process_parsed_messages, "
- "dispatch reply failed\n",
- this->id ()));
-
- return -1;
- }
-
}
else if (t == TAO_PLUGGABLE_MESSAGE_MESSAGERROR)
{