diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-01-12 09:54:12 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-01-12 09:54:12 +0000 |
commit | 65d6321dabb6bff9f6b434706591b3577929373f (patch) | |
tree | 82bb126caaffa7b469b8bfdf37e3fd2062b38dc2 /py/modules/IcePy/Communicator.cpp | |
parent | Added comment (diff) | |
download | ice-65d6321dabb6bff9f6b434706591b3577929373f.tar.bz2 ice-65d6321dabb6bff9f6b434706591b3577929373f.tar.xz ice-65d6321dabb6bff9f6b434706591b3577929373f.zip |
Fixed a bug where Ice plugin properties were not parse correctly
Diffstat (limited to 'py/modules/IcePy/Communicator.cpp')
-rw-r--r-- | py/modules/IcePy/Communicator.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp index 11f661eab15..395be689c70 100644 --- a/py/modules/IcePy/Communicator.cpp +++ b/py/modules/IcePy/Communicator.cpp @@ -147,19 +147,43 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/) seq = props->parseIceCommandLineOptions(seq); + // + // Remaining command line options are passed to the + // communicator with argc/argv. This is necessary for Ice + // plugin properties (e.g.: IceSSL). + // + int argc = seq.size(); + char** argv = new char*[argc + 1]; + int i = 0; + for(Ice::StringSeq::const_iterator s = seq.begin(); s != seq.end(); ++s, ++i) + { + argv[i] = strdup(s->c_str()); + } + argv[argc] = 0; + Ice::CommunicatorPtr communicator; try { - int argc = 0; - static char** argv = { 0 }; communicator = Ice::initializeWithPropertiesAndLogger(argc, argv, props, log); } catch(const Ice::Exception& ex) { + for(i = 0; i < argc + 1; ++i) + { + free(argv[i]); + } + delete[] argv; + setPythonException(ex); return -1; } + for(i = 0; i < argc + 1; ++i) + { + free(argv[i]); + } + delete[] argv; + // // Replace the contents of the given argument list with the filtered arguments. // |