diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-11-19 04:27:15 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-11-19 04:27:15 +0000 |
commit | 692304360a1f3e2fc9b29f62066203da65604731 (patch) | |
tree | c7fa8e1893307d3beb963d3189bd9531bde57463 /TAO/tao | |
parent | 63ca00d75dd64cf9bfa66d05b7a3e3b6a6f00a3a (diff) | |
download | ATCD-692304360a1f3e2fc9b29f62066203da65604731.tar.gz |
ChangeLogTag:
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/ORB.cpp | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index e30ffbacd17..e315fe3fd69 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1024,7 +1024,7 @@ CORBA::ORB::resolve_service (TAO_MCAST_SERVICEID mcast_service_id "ImplRepoServicePort", "InterfaceRepoServicePort" }; - + u_short default_service_port [] = { TAO_DEFAULT_NAME_SERVER_REQUEST_PORT, @@ -1032,67 +1032,67 @@ CORBA::ORB::resolve_service (TAO_MCAST_SERVICEID mcast_service_id TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT, TAO_DEFAULT_INTERFACEREPO_SERVER_REQUEST_PORT }; - + CORBA::Object_var return_value = CORBA::Object::_nil (); - + // By now, the table filled in with -ORBInitRef arguments has been // checked. We only get here if the table didn't contain an initial // reference for the requested Service. - + // First, determine if the port was supplied on the command line u_short port = this->orb_core_->orb_params ()->service_port (mcast_service_id); - + if (port == 0) { // Look for the port among our environment variables. const char *port_number = ACE_OS::getenv (env_service_port[mcast_service_id]); - + if (port_number != 0) port = (u_short) ACE_OS::atoi (port_number); else port = default_service_port[mcast_service_id]; } - + // Set the port value in ORB_Params: modify the default mcast // value. const char prefix[] = "mcast://:"; - + char port_char[256]; - + ACE_OS::itoa (port, port_char, 10); - + CORBA::String_var port_ptr = CORBA::string_alloc (ACE_static_cast (CORBA::ULong, ACE_OS::strlen ((const char *) port_char))); - + port_ptr = (const char *) port_char; - + CORBA::String_var def_init_ref = CORBA::string_alloc (sizeof (prefix) + ACE_static_cast (CORBA::ULong, ACE_OS::strlen (port_ptr.in ())) + 2); - + ACE_OS::strcpy (def_init_ref.inout (), prefix); ACE_OS::strcat (def_init_ref.inout (), port_ptr.in ()); ACE_OS::strcat (def_init_ref.inout (), "::"); - + CORBA::String_var default_init_ref = this->orb_core_->orb_params ()->default_init_ref (); - + static const char mcast_prefix[] = "mcast://:::"; - + if ((ACE_OS::strncmp (default_init_ref.in (), mcast_prefix, sizeof mcast_prefix - 1) == 0)) { this->orb_core_->orb_params ()->default_init_ref (def_init_ref.in ()); } - + return CORBA::Object::_nil (); } @@ -1162,24 +1162,29 @@ CORBA::ORB::resolve_initial_references (const char *name, if (this->orb_core_->init_ref_map ()->find (object_id, ior) == 0) return this->string_to_object (ior.c_str () ACE_ENV_ARG_PARAMETER); - + // Look for an environment variable called "<name>IOR". // CORBA::String_var ior_env_var_name = - CORBA::string_alloc( ACE_OS::strlen( name ) + 3 ) ; - ACE_OS::strcpy( ior_env_var_name, name ) ; - ACE_OS::strcat( ior_env_var_name, "IOR" ) ; + CORBA::string_alloc (ACE_OS::strlen (name) + 3); - ACE_CString service_ior = ACE_OS::getenv( ior_env_var_name ) ; + ACE_OS::strcpy (ior_env_var_name, + name); - if( ACE_OS::strcmp( service_ior.c_str (), "" ) != 0 ) - { - result = - this->string_to_object( service_ior.c_str() ACE_ENV_ARG_PARAMETER ) ; - ACE_CHECK_RETURN( CORBA::Object::_nil() ) ; + ACE_OS::strcat (ior_env_var_name, + "IOR"); - return result._retn() ; - } + ACE_CString service_ior = ACE_OS::getenv (ior_env_var_name); + + if (ACE_OS::strcmp (service_ior.c_str (), "") != 0 ) + { + result = + this->string_to_object (service_ior.c_str() + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + return result._retn (); + } // May be trying the explicitly specified services and the well // known services should be tried first before falling on to default |