summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Generator_Parser.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-28 20:33:52 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-28 20:33:52 +0000
commit52607f6e7ad6e1e1844977a4d87e04ae2ac72faf (patch)
treea3915c9b06448ce1f88be6c6b3fb6c2c5337dae4 /TAO/tao/GIOP_Message_Generator_Parser.cpp
parent7e420b992ff83889a838bf6f163a9e2c1bbf9cdd (diff)
downloadATCD-52607f6e7ad6e1e1844977a4d87e04ae2ac72faf.tar.gz
ChangeLogTag: Wed Feb 28 14:23:41 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/GIOP_Message_Generator_Parser.cpp')
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser.cpp108
1 files changed, 79 insertions, 29 deletions
diff --git a/TAO/tao/GIOP_Message_Generator_Parser.cpp b/TAO/tao/GIOP_Message_Generator_Parser.cpp
index 9d53560d613..fc431c2436b 100644
--- a/TAO/tao/GIOP_Message_Generator_Parser.cpp
+++ b/TAO/tao/GIOP_Message_Generator_Parser.cpp
@@ -24,21 +24,21 @@ TAO_GIOP_Message_Generator_Parser::parse_reply (
if (!stream.read_ulong (params.request_id_))
{
if (TAO_debug_level > 0)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, \n ")
ACE_TEXT ("extracting request id")),
-1);
}
- // and the reply status type. status can be NO_EXCEPTION,
+ // and the reply status type. status can be NO_EXCEPTION,
// SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD
// Cannot handle LOCATION_FORWARD_PERM here
- CORBA::ULong rep_stat = 0;
+ CORBA::ULong rep_stat = 0;
if (!stream.read_ulong (rep_stat))
{
if (TAO_debug_level > 0)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, \n ")
ACE_TEXT ("extracting reply status")),
-1);
@@ -46,48 +46,48 @@ TAO_GIOP_Message_Generator_Parser::parse_reply (
}
- // Pass the right Pluggable interface code to the transport layer
+ // Pass the right Pluggable interface code to the transport layer
switch (rep_stat)
{
// Request completed successfully
case TAO_GIOP_NO_EXCEPTION:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
+ TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION;
break;
// Request terminated with user exception
case TAO_GIOP_USER_EXCEPTION:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION;
+ TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION;
break;
- // Request terminated with system exception
+ // Request terminated with system exception
case TAO_GIOP_SYSTEM_EXCEPTION:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION;
+ TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION;
break;
// Reply is a location forward type
case TAO_GIOP_LOCATION_FORWARD:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
+ TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
break;
// Reply is a location forward perm type
- // @@For the time being the behaviour of the
- // LOCATION_FORWARD_PERM would be similar to the
- // LOCATION_FORWARD as there is a controversy surrounding the
+ // @@For the time being the behaviour of the
+ // LOCATION_FORWARD_PERM would be similar to the
+ // LOCATION_FORWARD as there is a controversy surrounding the
// usage of this in the OMG.
case TAO_GIOP_LOCATION_FORWARD_PERM:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
+ TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD;
break;
// Reply is a location forward type
case TAO_GIOP_NEEDS_ADDRESSING_MODE:
params.reply_status_ =
- TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE;
+ TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE;
break;
default:
if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%N|%l) Unknown reply status \n")));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%N|%l) Unknown reply status \n")));
}
return 0;
@@ -103,26 +103,26 @@ TAO_GIOP_Message_Generator_Parser::parse_locate_reply (
if (!cdr.read_ulong (params.request_id_))
{
if (TAO_debug_level > 0)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("TAO (%P|%t|%N|%l):parse_locate_reply, ")
ACE_TEXT ("extracting request id \n")),
-1);
}
- // and the reply status type. status can be NO_EXCEPTION,
+ // and the reply status type. status can be NO_EXCEPTION,
// SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD
// Cannot handle LOCATION_FORWARD_PERM here
- // Please note here that we are NOT converting to the Pluggable
+ // Please note here that we are NOT converting to the Pluggable
// messaging layer exception as this is GIOP specific. Not many
// messaging protocols have the locate_* messages.
if (!cdr.read_ulong (params.reply_status_))
{
if (TAO_debug_level > 0)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("TAO N|(%P|%t|l) parse_locate_reply, ")
- ACE_TEXT ("extracting reply status\n")),
+ ACE_TEXT ("extracting reply status\n")),
-1);
}
@@ -217,17 +217,67 @@ TAO_GIOP_Message_Generator_Parser::unmarshall_ref_addr (
CORBA::Boolean hdr_status =
(CORBA::Boolean) input.good_bit ();
- // Get the IOP::Tagged profile.
- GIOP::IORAddressingInfo &addr_info =
- profile_addr.addressing_info ();
+ /*
+ * The GIOP::IORAddressingInfo is defined as follows
+ * struct IORAddressingInfo
+ * {
+ * unsigned long selected_profile_index;
+ * IOP::IOR ior;
+ * };
+ *
+ * and the IOP::IOR is defined to be
+ * struct IOR
+ * {
+ * string type_id;
+ * sequence<TaggedProfile> profiles;
+ * };
+ */
+
+ // First read the profile index
+ CORBA::ULong prof_index = 0;
+
+ hdr_status =
+ hdr_status && input.read_ulong (prof_index);
+
+ // Set the value in TAO_Tagged_Profile
+ if (hdr_status)
+ profile_addr.profile_index (prof_index);
+
+ // Get the length of the type_id
+ CORBA::Long id_length = 0;
+ hdr_status = hdr_status && input.read_long (id_length);
+
+ if (hdr_status)
+ {
+ // Get the type_id
+ ACE_CString &type_id =
+ profile_addr.type_id ();
+
+ type_id.set (input.rd_ptr (),
+ 0);
+
+ input.skip_bytes (id_length);
+ }
- hdr_status &= input>> addr_info;
+ // Unmarshall the sequnce of TaggedProfiles
+ IOP::IOR::_tao_seq_TaggedProfile ior_profiles;
- IOP::TaggedProfile &tag =
- addr_info.ior.profiles [addr_info.selected_profile_index];
+ hdr_status &= input >> ior_profiles;
+
+ // Get the IOP::Tagged profile.
+ IOP::TaggedProfile &tagged_profile =
+ profile_addr.tagged_profile ();
+
+ // Get the right TaggedProfile from the <ior_profiles>
+ if (hdr_status)
+ {
+ tagged_profile =
+ ior_profiles [prof_index];
+ }
// Extract the object key from the TaggedProfile.
- hdr_status &= profile_addr.extract_object_key (tag);
+ hdr_status &=
+ profile_addr.extract_object_key (tagged_profile);
return hdr_status;
}