Author: aconway
Date: Mon Jan 28 07:27:39 2008
New Revision: 615910

URL: http://svn.apache.org/viewvc?rev=615910&view=rev
Log:
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. 

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp?rev=615910&r1=615909&r2=615910&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp Mon Jan 28 07:27:39 2008
@@ -90,7 +90,8 @@
         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 @@
     }
 };
 
-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 @@
     {
         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 @@
                 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);


Reply via email to