Add conditional remoting, remove nullptr reference.
authorScott Cantor <cantor.2@osu.edu>
Sun, 19 Sep 2010 18:05:05 +0000 (18:05 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sun, 19 Sep 2010 18:05:05 +0000 (18:05 +0000)
config_win32.h
cpp-sp-resolver.sln
shibresolver/resolver.cpp
shibresolver/resolver.h

index a7b3a24..a389d7b 100644 (file)
@@ -40,6 +40,9 @@
 /* Define if Shibboleth SP library was found */
 #define HAVE_SHIBSP 1
 
+/* Define to 1 if Shibboleth SP supports non-plugin remoting. */
+#define SHIBRESOLVER_SHIBSP_HAS_REMOTING 1
+
 /* Define to 1 if you have the <stdint.h> header file. */
 /* #undef HAVE_STDINT_H */
 
index d1fdab8..2ad7344 100644 (file)
@@ -1,9 +1,19 @@
 \r
 Microsoft Visual Studio Solution File, Format Version 11.00\r
 # Visual Studio 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "resolver", "shibresolver\resolver.vcxproj", "{36D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibresolver", "shibresolver\resolver.vcxproj", "{36D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "resolver-lite", "shibresolver\resolver-lite.vcxproj", "{36D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibresolver-lite", "shibresolver\resolver-lite.vcxproj", "{36D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}"\r
+EndProject\r
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3408DF00-FE03-41B1-AB95-9C45FF22DD44}"\r
+       ProjectSection(SolutionItems) = preProject\r
+               bootstrap = bootstrap\r
+               config_win32.h = config_win32.h\r
+               configure.ac = configure.ac\r
+               Makefile.am = Makefile.am\r
+               Portfile.in = Portfile.in\r
+               resolver.spec.in = resolver.spec.in\r
+       EndProjectSection\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
index 9a95fe8..dfea7c3 100644 (file)
@@ -35,19 +35,20 @@ using namespace xmltooling;
 using namespace std;
 
 namespace shibresolver {
-    class SHIBRESOLVER_DLLLOCAL ResolverImpl : public ShibbolethResolver, public Remoted {
+    class SHIBRESOLVER_DLLLOCAL RemotedResolver : public Remoted {
     public:
-        ResolverImpl() {}
-        ~ResolverImpl() {}
+        RemotedResolver() {}
+        ~RemotedResolver() {}
 
-        void resolve();
         void receive(DDF& in, ostream& out);
     };
+
+    static RemotedResolver g_Remoted;
 };
 
 ShibbolethResolver* ShibbolethResolver::create()
 {
-    return new ResolverImpl();
+    return new ShibbolethResolver();
 }
 
 ShibbolethResolver::ShibbolethResolver()
@@ -112,17 +113,21 @@ RequestMapper::Settings ShibbolethResolver::getSettings() const
     return m_settings;
 }
 
-void ResolverImpl::resolve()
+void ShibbolethResolver::resolve()
 {
 }
 
-void ResolverImpl::receive(DDF& in, ostream& out)
+void RemotedResolver::receive(DDF& in, ostream& out)
 {
 }
 
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
-    // Register factory functions with appropriate plugin managers in the XMLTooling/SAML/SPConfig objects.
+#ifdef SHIBRESOLVER_SHIBSP_HAS_REMOTING
+    SPConfig& conf = SPConfig::getConfig();
+    if (conf.isEnabled(SPConfig::OutOfProcess) && !conf.isEnabled(SPConfig::InProcess) && conf.isEnabled(SPConfig::Listener))
+        conf.getServiceProvider()->regListener("org.project-moonshot.shibresolver", &g_Remoted);
+#endif
     return 0;   // signal success
 }
 
index 947e8ab..e3a6c0c 100644 (file)
@@ -149,7 +149,7 @@ namespace shibresolver {
 #else
             unsigned long features = shibsp::SPConfig::OutOfProcess,
 #endif
-            const char* config = nullptr,
+            const char* config = NULL,
             bool rethrow = false
             );