diff options
author | Alan Conway <aconway@apache.org> | 2008-01-28 15:27:39 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-01-28 15:27:39 +0000 |
commit | 2293d3ac53c9b2002dfe12a7be1cfd10b977495d (patch) | |
tree | 96d2585b0e923814fc177f25298b455cfa409fc6 | |
parent | 901073e4e0662b693219c78bc56bebeddbc0bee0 (diff) | |
download | qpid-python-2293d3ac53c9b2002dfe12a7be1cfd10b977495d.tar.gz |
Patch from Ted Ross, QPID-744
Two bugs are fixed in this patch:
1) A plug-in module with no configuration options caused the broker to crash when the module was loaded.
2) Failure to load a module called out in --load-module now causes the broker to exit. Failure to load a module via --load-dir is logged but does not cause the broker to exit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@615910 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpidd.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp index 7be6aea464..0b8ab4076c 100644 --- a/qpid/cpp/src/qpidd.cpp +++ b/qpid/cpp/src/qpidd.cpp @@ -90,7 +90,8 @@ struct QpiddOptions : public qpid::Options { for (Plugin::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) - add(*(*i)->getOptions()); + if ((*i)->getOptions() != 0) + add(*(*i)->getOptions()); } void usage() const { @@ -141,12 +142,15 @@ struct QpiddDaemon : public Daemon { } }; -void tryShlib(const char* libname) { +void tryShlib(const char* libname, bool noThrow) { try { Shlib shlib(libname); QPID_LOG (info, "Loaded Module: " << libname); } - catch (const exception& e) {} + catch (const exception& e) { + if (!noThrow) + throw; + } } void loadModuleDir (string dirname, bool isDefault) @@ -165,7 +169,7 @@ void loadModuleDir (string dirname, bool isDefault) { if (!fs::is_directory(*itr) && itr->string().find (".so") == itr->string().length() - 3) - tryShlib (itr->string().data()); + tryShlib (itr->string().data(), true); } } @@ -187,7 +191,7 @@ int main(int argc, char* argv[]) for (vector<string>::iterator iter = bootOptions.module.load.begin(); iter != bootOptions.module.load.end(); iter++) - tryShlib (iter->data()); + tryShlib (iter->data(), false); bool isDefault = defaultPath == bootOptions.module.loadDir; loadModuleDir (bootOptions.module.loadDir, isDefault); |