diff options
author | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-04-18 12:35:20 +0000 |
---|---|---|
committer | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-04-18 12:35:20 +0000 |
commit | b04dfc433200011c675b7bcd3a6d5af1365965a5 (patch) | |
tree | 6114c67d44b769d6b68ca7e85683639f9c3dbf88 | |
parent | a363931fc87eae40513c75a9e957757b40113bc8 (diff) | |
download | ATCD-b04dfc433200011c675b7bcd3a6d5af1365965a5.tar.gz |
Merged revisions 81360,81364,81373 via svnmerge from
https://svn.dre.vanderbilt.edu/DOC/Middleware/trunk/TAO
........
r81360 | iliyan | 2008-04-14 15:15:12 -0500 (Mon, 14 Apr 2008) | 1 line
ChangeLogTag: Mon Apr 14 20:14:18 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
........
r81364 | iliyan | 2008-04-15 07:17:12 -0500 (Tue, 15 Apr 2008) | 1 line
ChangeLogTag: Tue Apr 15 12:15:35 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
........
r81373 | iliyan | 2008-04-16 08:05:29 -0500 (Wed, 16 Apr 2008) | 1 line
ChangeLogTag: Wed Apr 16 13:03:25 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
........
-rw-r--r-- | TAO/ChangeLog | 27 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/TAO_Internal.cpp | 101 | ||||
-rw-r--r-- | TAO/tao/TAO_Internal.h | 2 |
4 files changed, 70 insertions, 71 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 78a0031299e..8733ca4cebb 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,30 @@ +Wed Apr 16 13:03:25 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> + + * tao/TAO_Internal.cpp: + + Synthetic arguments for -ORBSvcConfDirective must be quoted to + ensure correct interpretation. + +Tue Apr 15 12:15:35 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> + + * tao/TAO_Internal.cpp: + + Turns out ACE_ARGV only allows "iterative" use (e.g. adding new + arguments to the list), when created with one of the ctors. + +Mon Apr 14 20:14:18 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> + + * tao/ORB.cpp: + * tao/TAO_Internal.h: + + Adding a wchar/char conversion before calling the + initialization. + + * tao/TAO_Internal.cpp: + + Removing the use of CORBA::StringSeq to store intermediate + argument lists in favor of ACE_ARGV, which is more wchar-aware. + Fri Apr 11 10:50:37 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> * tao/TAO_Internal.cpp: diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index f527376706b..72ae4300527 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1200,6 +1200,11 @@ CORBA::ORB_init (int &argc, char *argv[], const char *orbid) CORBA::COMPLETED_NO); } + // Copy command line parameter not to corrupt the original. + ACE_Argv_Type_Converter command_line(argc, argv); + int tmpargc = command_line.get_argc (); + ACE_TCHAR **tmpargv = command_line.get_TCHAR_argv (); + // Scan the parameters to find any we could interpret to // use for initializing the global context. Note that if // the global context has been initialized already, the @@ -1207,15 +1212,11 @@ CORBA::ORB_init (int &argc, char *argv[], const char *orbid) // a local configuration context. The chosen action depends on // weather we want the ORB to share the global context or // have its own, private (or local) context. - if (TAO::ORB::open_global_services (argc, argv) == -1) + if (TAO::ORB::open_global_services (tmpargc, tmpargv) == -1) { return CORBA::ORB::_nil (); } - // Copy command line parameter not to corrupt the original. - ACE_Argv_Type_Converter command_line(argc, argv); - - // Make sure the following is done after the global ORB // initialization since we need to have exceptions initialized. diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index 308ddfec94b..4a1852defc2 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -21,7 +21,6 @@ #include "tao/Codeset_Manager_Factory_Base.h" #include "tao/Codeset_Manager.h" #include "tao/debug.h" -#include "tao/StringSeqC.h" #include "ace/Dynamic_Service.h" #include "ace/Arg_Shifter.h" @@ -69,7 +68,7 @@ namespace int parse_global_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq &svc_config_argv, + ACE_ARGV &svc_config_argv, bool apply_values); /** @@ -85,7 +84,7 @@ namespace int parse_svcconf_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq &svc_config_argv); + ACE_ARGV &svc_config_argv); /** * Initialize the ACE Service Configurator with the process-global @@ -117,7 +116,7 @@ namespace int parse_private_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq & svc_config_argv, + ACE_ARGV & svc_config_argv, bool & skip_service_config_open); /** @@ -129,7 +128,7 @@ namespace */ int open_private_services_i (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg, int & argc, - char ** argv, + ACE_TCHAR **argv, bool skip_service_config_open = false, bool ignore_default_svc_conf_file = false); @@ -201,7 +200,7 @@ namespace /// Note that the argument vector will be corrupted upon return int TAO::ORB::open_global_services (int argc, - char **argv) + ACE_TCHAR **argv) { { // Count of the number of (times we did this for all) ORBs. @@ -245,16 +244,13 @@ namespace register_global_services_i (theone); - // Be certain to copy the program name so that service configurator - // has something to skip! - ACE_CString argv0 ((argc <= 0 || argv == 0) - ? ACE_TEXT ("") : ACE_TEXT_ALWAYS_CHAR (argv[0])); // Construct an argument vector specific to the process-wide // (global) Service Configurator instance. - CORBA::StringSeq global_svc_config_argv; - global_svc_config_argv.length (1); - global_svc_config_argv[0] = argv0.c_str (); + // Be certain to copy the program name so that service configurator + // has something to skip! + ACE_ARGV global_svc_config_argv (true); // only this ctor allows subsequent use of add()! + global_svc_config_argv.add ((argc <= 0 || argv == 0) ? ACE_TEXT ("") : argv[0]); // Will expand the environment variables, if any were used. Is this a good thing? // I guess it provides greater flexibility for deployment, so let's leave it. Will @@ -290,10 +286,10 @@ namespace return -1; // Perform the open magic (unless SC::open() has been called already) - int global_svc_config_argc = global_svc_config_argv.length (); + int global_svc_config_argc = global_svc_config_argv.argc (); int status = open_private_services_i (theone, global_svc_config_argc, - global_svc_config_argv.get_buffer (), + global_svc_config_argv.argv (), skip_service_config_open); // okay? @@ -382,21 +378,13 @@ TAO::ORB::open_services (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg, // Construct an argument vector specific to the Service // Configurator. - CORBA::StringSeq svc_config_argv; - // Be certain to copy the program name so that service configurator // has something to skip! - ACE_CString argv0 ((argc <= 0 || argv == 0) ? "" : ACE_TEXT_ALWAYS_CHAR (argv[0])); - svc_config_argv.length (1); - svc_config_argv[0] = argv0.c_str (); - - // Should we skip the ACE_Service_Config::open() method, e.g., if we - // already being configured by the ACE Service Configurator. - // - // @@ This is no longer needed since the Service Configurator is now - // reentrant.(-Ossama) - // @@ Leaving it in, since the -ORBSkipServiceConfigOpen is still - // available. (-Iliyan) + ACE_ARGV svc_config_argv (true); // only this ctor allows subsequent use of add()! + svc_config_argv.add ((argc <= 0 || argv == 0) ? ACE_TEXT ("") : argv[0]); + + // Should we skip the ACE_Service_Config::open() method?, + // e.g., because of -ORBSkipServiceConfigOpen bool skip_service_config_open = false; // Extract any ORB options from the argument vector. @@ -410,10 +398,12 @@ TAO::ORB::open_services (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg, // Construct an argument vector specific to the process-wide // (global) Service Configurator instance. - CORBA::StringSeq global_svc_config_argv; - // Parse any globally applicable arguments, but do not make them effective. We are effectively purging the command line from them without affecting the global state - after all, it may be a private (local) configuration context. - int status = - parse_global_args_i(argc, argv, global_svc_config_argv, false); + ACE_ARGV global_svc_config_argv; + + // Parse any globally applicable arguments, but do not make them effective. + // We are effectively purging the command line from them without affecting + // the global state - after all, it may be a private (local) configuration context. + int status = parse_global_args_i(argc, argv, global_svc_config_argv, false); if (status == -1 && TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, @@ -434,11 +424,11 @@ TAO::ORB::open_services (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg, // only open the private context if it is not also the global context if (pcfg != ACE_Service_Config::global()) { - int svc_config_argc = svc_config_argv.length (); + int svc_config_argc = svc_config_argv.argc (); status = open_private_services_i (pcfg, svc_config_argc, - svc_config_argv.get_buffer (), + svc_config_argv.argv (), skip_service_config_open); } @@ -488,7 +478,7 @@ namespace int open_private_services_i (ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> pcfg, int & argc, - char ** argv, + ACE_TCHAR ** argv, bool skip_service_config_open, bool ignore_default_svc_conf_file) { @@ -722,13 +712,11 @@ namespace int parse_svcconf_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq &svc_config_argv) + ACE_ARGV &svc_config_argv) { // Extract the Service Configurator ORB options from the argument // vector. ACE_Arg_Shifter arg_shifter (argc, argv); - CORBA::ULong len = 0; - while (arg_shifter.is_anything_left ()) { @@ -760,12 +748,8 @@ namespace ACE_OS::fclose (conf_file); } - len = svc_config_argv.length (); - svc_config_argv.length (len + 2); // 2 arguments to add - - svc_config_argv[len] = CORBA::string_dup ("-f"); - svc_config_argv[len + 1] = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg)); + svc_config_argv.add (ACE_TEXT ("-f")); + svc_config_argv.add (current_arg); } else { @@ -781,13 +765,12 @@ namespace int parse_private_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq &svc_config_argv, + ACE_ARGV &svc_config_argv, bool & skip_service_config_open) { // Extract the Service Configurator ORB options from the argument // vector. ACE_Arg_Shifter arg_shifter (argc, argv); - CORBA::ULong len = 0; while (arg_shifter.is_anything_left ()) { @@ -802,28 +785,20 @@ namespace else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT ("-ORBSvcConfDirective")))) { - len = svc_config_argv.length (); - svc_config_argv.length (len + 2); // 2 arguments to add - // This is used to pass arguments to the Service // Configurator using the "command line" to provide // configuration information rather than using a svc.conf // file. Pass the "-S" to the service configurator. - svc_config_argv[len] = CORBA::string_dup ("-S"); - svc_config_argv[len + 1] = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg)); + svc_config_argv.add (ACE_TEXT ("-S")); + svc_config_argv.add (current_arg, true); // quote args! arg_shifter.consume_arg (); } else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT ("-ORBServiceConfigLoggerKey")))) { - len = svc_config_argv.length (); - svc_config_argv.length (len + 2); // 2 arguments to add - - svc_config_argv[len] = CORBA::string_dup ("-k"); - svc_config_argv[len + 1] = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (current_arg)); + svc_config_argv.add (ACE_TEXT ("-k")); + svc_config_argv.add (current_arg, true); // quote args! arg_shifter.consume_arg (); } @@ -838,6 +813,7 @@ namespace if (0 != (current_arg = arg_shifter.get_current())) negotiate_codesets = (ACE_OS::atoi (current_arg)); + arg_shifter.ignore_arg(); } else if (0 != (current_arg = @@ -865,7 +841,7 @@ namespace int parse_global_args_i (int &argc, ACE_TCHAR **argv, - CORBA::StringSeq &svc_config_argv, + ACE_ARGV &svc_config_argv, bool apply_values) { // NOTE: When adding new global arguments, ensure they are only @@ -898,7 +874,6 @@ namespace // Extract the Service Configurator ORB options from the argument // vector. ACE_Arg_Shifter arg_shifter (argc, argv); - CORBA::ULong len = 0; while (arg_shifter.is_anything_left ()) { @@ -919,11 +894,7 @@ namespace // Be a daemon. if (apply_values) { - len = svc_config_argv.length (); - svc_config_argv.length (len + 1); - - svc_config_argv[len] = - CORBA::string_dup ("-b"); + svc_config_argv.add (ACE_TEXT("-b")); } arg_shifter.consume_arg (); diff --git a/TAO/tao/TAO_Internal.h b/TAO/tao/TAO_Internal.h index ee173949e02..68daef75460 100644 --- a/TAO/tao/TAO_Internal.h +++ b/TAO/tao/TAO_Internal.h @@ -50,7 +50,7 @@ namespace TAO * argument vector, and initialize the _global_ configuration gestalt. Return value 0 means OK, * -1 spells major trouble ... */ - int open_global_services (int argc, char** argv); + int open_global_services (int argc, ACE_TCHAR** argv); /** * Extract ACE Service Configurator arguments from the given |