summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-13 03:56:18 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-13 03:56:18 +0000
commit26add143442ceb66dae7a1af96b61d647edc7143 (patch)
treea2cb4b24de92f3b72451160f5d56db5acf694d4a
parent9da02ae3815b72b30318293da874811c42f3c3f2 (diff)
downloadATCD-26add143442ceb66dae7a1af96b61d647edc7143.tar.gz
ChangeLogTag : Mon Jul 12 22:55:55 1999 Alexander Babu Arulanthu <alex@cs.wustl.edu>
-rw-r--r--TAO/tao/GIOP.cpp13
-rw-r--r--TAO/tao/GIOP.h6
-rw-r--r--TAO/tao/IIOP_Connect.cpp32
-rw-r--r--TAO/tao/IIOP_Connect.h7
-rw-r--r--TAO/tao/UIOP_Connect.cpp36
-rw-r--r--TAO/tao/UIOP_Connect.h6
6 files changed, 83 insertions, 17 deletions
diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp
index 6711c61156d..a4d944796fe 100644
--- a/TAO/tao/GIOP.cpp
+++ b/TAO/tao/GIOP.cpp
@@ -879,7 +879,8 @@ int
TAO_GIOP::process_server_message (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
TAO_InputCDR &input,
- const TAO_GIOP_Message_State &state)
+ const CORBA::Octet &message_type,
+ const TAO_GIOP_Version &giop_version)
{
char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
#if defined(ACE_HAS_PURIFY)
@@ -897,8 +898,8 @@ TAO_GIOP::process_server_message (TAO_Transport *transport,
orb_core->to_unicode ());
TAO_MINIMAL_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_RECEIVE_REQUEST_END);
-
- switch (state.message_type)
+
+ switch (message_type)
{
case TAO_GIOP::Request:
// The following two routines will either raise an exception
@@ -907,14 +908,14 @@ TAO_GIOP::process_server_message (TAO_Transport *transport,
orb_core,
input,
output,
- state.giop_version);
+ giop_version);
case TAO_GIOP::LocateRequest:
return TAO_GIOP::process_server_locate (transport,
orb_core,
input,
output,
- state.giop_version);
+ giop_version);
case TAO_GIOP::MessageError:
if (TAO_debug_level > 0)
@@ -932,7 +933,7 @@ TAO_GIOP::process_server_message (TAO_Transport *transport,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO (%P|%t) Illegal message received by server\n"));
- return TAO_GIOP::send_error (state.giop_version, transport);
+ return TAO_GIOP::send_error (giop_version, transport);
}
TAO_MINIMAL_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_END);
diff --git a/TAO/tao/GIOP.h b/TAO/tao/GIOP.h
index b77c893a44b..ae666b93873 100644
--- a/TAO/tao/GIOP.h
+++ b/TAO/tao/GIOP.h
@@ -474,11 +474,13 @@ public:
TAO_GIOP_ServiceContextList& reply_ctx,
CORBA::ULong& request_id,
CORBA::ULong& reply_status);
+
static int process_server_message (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
TAO_InputCDR &input,
- const TAO_GIOP_Message_State& state);
-
+ const CORBA::Octet &message_type,
+ const TAO_GIOP_Version &giop_version);
+
static int process_server_request (TAO_Transport *transport,
TAO_ORB_Core* orb_core,
TAO_InputCDR &input,
diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp
index fa6615cbc5c..a1e1448599d 100644
--- a/TAO/tao/IIOP_Connect.cpp
+++ b/TAO/tao/IIOP_Connect.cpp
@@ -66,7 +66,12 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thre
: TAO_IIOP_Handler_Base (t),
transport_ (this, 0),
orb_core_ (0),
- tss_resources_ (0)
+ tss_resources_ (0),
+ // This will bomb if get called. But this constructor shouldnt be
+ // called anyway.
+ input_cdr_ (orb_core_->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core_)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -80,7 +85,10 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_
: TAO_IIOP_Handler_Base (orb_core),
transport_ (this, orb_core),
orb_core_ (orb_core),
- tss_resources_ (orb_core->get_tss_resources ())
+ tss_resources_ (orb_core->get_tss_resources ()),
+ input_cdr_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core)
{
}
@@ -236,10 +244,26 @@ TAO_IIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
if (result == 0 || result == -1)
return result;
+ // = Take out all the information from the <message_state> and reset
+ // it so that nested upcall on the same Transport can be handled.
+
+ // Copy message type.
+ CORBA::Octet message_type = this->transport_.message_state_.message_type;
+
+ // Copy version.
+ TAO_GIOP_Version giop_version = this->transport_.message_state_.giop_version;
+
+ // Steal the input CDR from the message state.
+ TAO_InputCDR input_cdr (this->transport_.message_state_.cdr);
+
+ // Reset the message state.
+ this->transport_.message_state_.reset ();
+
result = TAO_GIOP::process_server_message (this->transport (),
this->orb_core_,
- this->transport_.message_state_.cdr,
- this->transport_.message_state_);
+ input_cdr,
+ message_type,
+ giop_version);
if (result != -1)
{
this->transport_.message_state_.reset ();
diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h
index c53c2315c84..ec46b43c06b 100644
--- a/TAO/tao/IIOP_Connect.h
+++ b/TAO/tao/IIOP_Connect.h
@@ -149,6 +149,13 @@ protected:
TAO_ORB_Core_TSS_Resources *tss_resources_;
// Cached tss resources of the ORB that activated this object.
+
+ TAO_InputCDR input_cdr_;
+ // CDR used to steal the input cdr contents from the message
+ // state. This is done so that we can reset the message state
+ // before making the upcall. This makes the transport to handle the
+ // Nestedupcall requests coming on the same socket.
+
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp
index f3de2b41e0c..1da2cb91ea8 100644
--- a/TAO/tao/UIOP_Connect.cpp
+++ b/TAO/tao/UIOP_Connect.cpp
@@ -70,7 +70,12 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre
: TAO_UIOP_Handler_Base (t),
transport_ (this, 0),
orb_core_ (0),
- tss_resources_ (0)
+ tss_resources_ (0),
+ // This will bomb if get called. But this constructor shouldnt be
+ // called anyway.
+ input_cdr_ (orb_core_->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core_)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -84,7 +89,10 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_
: TAO_UIOP_Handler_Base (orb_core),
transport_ (this, orb_core),
orb_core_ (orb_core),
- tss_resources_ (orb_core->get_tss_resources ())
+ tss_resources_ (orb_core->get_tss_resources ()),
+ input_cdr_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core)
{
}
@@ -227,11 +235,29 @@ TAO_UIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
if (result == 0 || result == -1)
return result;
-
+
+ // = Take out all the information from the <message_state> and reset
+ // it so that nested upcall on the same Transport can be handled.
+
+ // Copy message type.
+ CORBA::Octet message_type = this->transport_.message_state_.message_type;
+
+ // Copy version.
+ TAO_GIOP_Version giop_version = this->transport_.message_state_.giop_version;
+
+ // Steal the input CDR from the message state.
+ TAO_InputCDR input_cdr (this->transport_.message_state_.cdr,
+ this->transport_.message_state_.cdr.length ());
+
+ // Reset the message state.
+ this->transport_.message_state_.reset ();
+
result = TAO_GIOP::process_server_message (this->transport (),
this->orb_core_,
- this->transport_.message_state_.cdr,
- this->transport_.message_state_);
+ this->input_cdr_,
+ message_type,
+ giop_version);
+
if (result != -1)
{
this->transport_.message_state_.reset ();
diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h
index ec1296023e6..74de6a963a1 100644
--- a/TAO/tao/UIOP_Connect.h
+++ b/TAO/tao/UIOP_Connect.h
@@ -150,6 +150,12 @@ protected:
TAO_ORB_Core_TSS_Resources *tss_resources_;
// Cached tss resources of the ORB that activated this object.
+
+ TAO_InputCDR input_cdr_;
+ // CDR used to steal the input cdr contents from the message
+ // state. This is done so that we can reset the message state
+ // before making the upcall. This makes the transport to handle the
+ // Nestedupcall requests coming on the same socket.
};
#if defined (__ACE_INLINE__)