From 33a39c240156c51c6c4936f218d76f53d6b62ad5 Mon Sep 17 00:00:00 2001 From: harrisb Date: Thu, 17 Jan 2013 15:34:11 +0000 Subject: Thu Jan 17 15:32:12 UTC 2013 Byron Harris --- TAO/OCI_RE_ChangeLog | 8 ++++++ .../orbsvcs/PortableGroup/PG_Object_Group.cpp | 29 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/TAO/OCI_RE_ChangeLog b/TAO/OCI_RE_ChangeLog index 11864232b5d..6c771339687 100644 --- a/TAO/OCI_RE_ChangeLog +++ b/TAO/OCI_RE_ChangeLog @@ -1,3 +1,11 @@ +Thu Jan 17 15:32:12 UTC 2013 Byron Harris + + * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp: + + Throw exception if trying to add a member whose first + profile is at IIOP version 1.0 since this version does + not support tagged components. + Thu Jan 17 14:36:29 UTC 2013 Phil Mesnier * bin/tao_orb_tests.lst: diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp index 534ecb114e9..c53cac7b1d3 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp @@ -6,6 +6,9 @@ #include "orbsvcs/PortableGroup/PG_Operators.h" // Borrow operator== on CosNaming::Name #include "orbsvcs/PortableGroup/PG_Utils.h" +#include "tao/MProfile.h" +#include "tao/Profile.h" +#include "tao/Stub.h" #include "tao/debug.h" #include "ace/Get_Opt.h" @@ -213,6 +216,32 @@ TAO::PG_Object_Group::add_member (const PortableGroup::Location & the_location, // IORs, not IOGRs to send new IOGRs out // to replicas. + // Verify that the member is not using V1.0 profiles + // since IIOP V1.0 does not support tagged components + const TAO_MProfile &member_profiles = + member->_stubobj ()->base_profiles (); + CORBA::ULong member_profile_count = + member_profiles.profile_count (); + if (member_profile_count > 0) + { + const TAO_GIOP_Message_Version & version = + member_profiles.get_profile (0)->version (); + if (version.major_version () == 1 && + version.minor_version () == 0) + { + if (TAO_debug_level > 3) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%T %n (%P|%t) - ") + ACE_TEXT ("Can't add member because first profile ") + ACE_TEXT ("is IIOP version 1.0, which does not ") + ACE_TEXT ("support tagged components.\n") + )); + } + throw PortableGroup::ObjectNotAdded (); + } + } + CORBA::String_var member_ior_string = orb_->object_to_string (member); -- cgit v1.2.1