summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2005-04-10 02:25:32 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2005-04-10 02:25:32 +0000
commitbca0fe7d5ad39e1d3f9a6654bb4e00d6e8c94548 (patch)
treee121754889c3d209bba23c32a6c15fc721b3cc9e
parentfdf30e5d0d7fbb7bd3889131206fa23db51b0ce4 (diff)
downloadATCD-bca0fe7d5ad39e1d3f9a6654bb4e00d6e8c94548.tar.gz
ChangeLog tag: Sat Apr 9 21:19:51 2005 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog10
-rwxr-xr-xTAO/examples/ior_corbaloc/run_test.pl3
-rw-r--r--TAO/tao/CORBALOC_Parser.cpp5
-rw-r--r--TAO/tao/CORBANAME_Parser.cpp26
4 files changed, 21 insertions, 23 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index db92a88ca11..691f98232ad 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,13 @@
+Sat Apr 9 21:19:51 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * examples/ior_corbaloc/run_test.pl:
+ * tao/CORBALOC_Parser.cpp:
+ * tao/CORBANAME_Parser.cpp:
+
+ Fixed support for default object key when using either corbaloc:
+ or corbaname: urls. Added a case to the ior_corbaloc example
+ to cover the case of defaulted RIR corbanames.
+
Sat Apr 9 10:07:02 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
* tests/Bug_1535_Regression/bug_1535_regression.cpp
diff --git a/TAO/examples/ior_corbaloc/run_test.pl b/TAO/examples/ior_corbaloc/run_test.pl
index debae994807..9a1248bfabf 100755
--- a/TAO/examples/ior_corbaloc/run_test.pl
+++ b/TAO/examples/ior_corbaloc/run_test.pl
@@ -115,7 +115,8 @@ print STDERR "\n======= Running corbaname: tests\n";
"corbaname::$TARGETHOSTNAME:$ns_orb_port[0]#$SR_NAME[0]",
"corbaname::$TARGETHOSTNAME#$SR_NAME[1]",
- "corbaname::$TARGETHOSTNAME:$ns_orb_port[1]#$SR_NAME[1]");
+ "corbaname::$TARGETHOSTNAME:$ns_orb_port[1]#$SR_NAME[1]",
+ "corbaname:rir:#$SR_NAME[1] -orbinitref NameService=file://$iorfile[1]");
foreach $o ( @corbaname_tests ){
print STDERR "\n$test_number: $o\n";
diff --git a/TAO/tao/CORBALOC_Parser.cpp b/TAO/tao/CORBALOC_Parser.cpp
index b3b8e13c64f..7195af0ca0c 100644
--- a/TAO/tao/CORBALOC_Parser.cpp
+++ b/TAO/tao/CORBALOC_Parser.cpp
@@ -25,7 +25,7 @@ TAO_CORBALOC_Parser::~TAO_CORBALOC_Parser (void)
static const char prefix[] = "corbaloc:";
static const size_t prefix_len = sizeof prefix - 1;
-static const char rir_token[] = "rir:/"; // includes key separator
+static const char rir_token[] = "rir:";
static const size_t rir_token_len = sizeof rir_token - 1;
static const char iiop_token[] = "iiop:";
static const char iiop_token_len = sizeof iiop_token - 1;
@@ -78,6 +78,9 @@ TAO_CORBALOC_Parser::parse_string_rir_helper (const char * ior,
// Pass the key string as an argument to resolve_initial_references.
// NameService is the default if an empty key string is supplied.
const char *objkey = ior + rir_token_len;
+ if (*objkey == '/') // there is an explicit object key, which may
+ // validly be null.
+ objkey++;
CORBA::Object_var rir_obj =
orb->resolve_initial_references (*objkey == '\0' ? "NameService" :
diff --git a/TAO/tao/CORBANAME_Parser.cpp b/TAO/tao/CORBANAME_Parser.cpp
index e330e093a26..ec3998eb794 100644
--- a/TAO/tao/CORBANAME_Parser.cpp
+++ b/TAO/tao/CORBANAME_Parser.cpp
@@ -81,8 +81,6 @@ TAO_CORBANAME_Parser::parse_string (const char *ior,
ACE_TRY
{
- char rir_prot [] = "rir:";
-
// The position of the seperator between the obj_addr and key
// string
CORBA::ULong pos_seperator = 0;
@@ -96,26 +94,12 @@ TAO_CORBANAME_Parser::parse_string (const char *ior,
corbaname_str.substring (pos_seperator + 1,
-1);
- // Make it in a form understandable by <corbaloc> scheme
+ // Prepare a suitable corbaloc string for the name service.
+ // CORBALOC assumes "NameService" for the object key if none
+ // is provided, so just pass everything between "corbaname:"
+ // and "#" as the address
ACE_CString corbaloc_addr ("corbaloc:", 0, 1);
-
- if (ACE_OS::strncmp (corbaname,
- rir_prot,
- sizeof (rir_prot)) != 0)
- {
- // Implies that <iiop:> protocol is to be used.
- // So .. we need to get the host address where an object of
- // type NamingContext can be found.
- // Get the obj_addr
- ACE_CString obj_addr = corbaname_str.substring (0,
- pos_seperator);
-
- corbaloc_addr += obj_addr;
-
- }
-
- ACE_CString name_service ("/NameService", 0, 1);
- corbaloc_addr += name_service;
+ corbaloc_addr += corbaname_str.substring (0, pos_seperator);
// Obtain a reference to the naming context
CORBA::Object_var name_context =