Removed RPCHandle code.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 4 Feb 2004 04:53:23 +0000 (04:53 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 4 Feb 2004 04:53:23 +0000 (04:53 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@799 cb58f699-b61c-0410-a6fe-9272a202ed29

isapi_shib/isapi_shib.cpp
mod_shibrm/mod_shibrm.cpp
mod_shire/mod_shire.cpp

index 8c4884d..3d8c755 100644 (file)
@@ -80,16 +80,10 @@ using namespace shibtarget;
 // globals
 namespace {
     HINSTANCE g_hinstDLL;
-    ThreadKey* rpc_handle_key = NULL;
     ShibTargetConfig* g_Config = NULL;
     vector<string> g_Sites;
 }
 
-void destroy_handle(void* data)
-{
-    delete (RPCHandle*)data;
-}
-
 BOOL LogEvent(
     LPCSTR  lpUNCServerName,
     WORD  wType,
@@ -139,9 +133,6 @@ extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer)
         g_Config = &(ShibTargetConfig::init(SHIBTARGET_SHIRE, getenv("SHIBCONFIG")));
         ShibINI& ini = g_Config->getINI();
 
-        // Create the RPC Handle TLS key.
-        rpc_handle_key=ThreadKey::create(destroy_handle);
-
         Category& log=Category::getInstance("isapi_shib.GetFilterVersion");
 
         // Read site-specific settings for each instance ID we can find.
@@ -200,7 +191,6 @@ extern "C" BOOL WINAPI TerminateExtension(DWORD)
 
 extern "C" BOOL WINAPI TerminateFilter(DWORD)
 {
-    delete rpc_handle_key;
     if (g_Config)
         g_Config->shutdown();
     g_Config = NULL;
@@ -497,14 +487,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
         if (!ini.get_tag(application_id, "accessError", true, &shireError))
             return WriteClientError(pfc,"The accessError configuration setting is missing, check configuration.");
         
-        // Get an RPC handle and build the SHIRE object.
-        RPCHandle* rpc_handle = (RPCHandle*)rpc_handle_key->getData();
-        if (!rpc_handle)
-        {
-            rpc_handle = new RPCHandle(shib_target_sockname(), SHIBRPC_PROG, SHIBRPC_VERS_1);
-            rpc_handle_key->setData(rpc_handle);
-        }
-        SHIRE shire(rpc_handle, config, shire_url.c_str());
+        SHIRE shire(config, shire_url.c_str());
 
         // Check for authentication cookie.
         const char* session_id=NULL;
@@ -583,7 +566,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
         // Move to RM phase.
         RMConfig rm_config;
         rm_config.checkIPAddress = config.checkIPAddress;
-        RM rm(rpc_handle,rm_config);
+        RM rm(rm_config);
 
         // Get the attributes.
         vector<SAMLAssertion*> assertions;
@@ -859,14 +842,7 @@ extern "C" DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
         markupProcessor.insert("logoLocation", has_tag ? tag : "");
         markupProcessor.insert("requestURL", target_url.c_str());
   
-        // Get an RPC handle and build the SHIRE object.
-        RPCHandle* rpc_handle = (RPCHandle*)rpc_handle_key->getData();
-        if (!rpc_handle)
-        {
-            rpc_handle = new RPCHandle(shib_target_sockname(), SHIBRPC_PROG, SHIBRPC_VERS_1);
-            rpc_handle_key->setData(rpc_handle);
-        }
-        SHIRE shire(rpc_handle, config, shire_url.c_str());
+        SHIRE shire(config, shire_url.c_str());
 
         // Process SHIRE POST
         if (ini.get_tag(application_id, "shireSSLOnly", true, &tag) && ShibINI::boolean(tag))
index f8340c7..272cf23 100644 (file)
@@ -34,7 +34,6 @@ using namespace shibboleth;
 using namespace shibtarget;
 
 namespace {
-    ThreadKey* rpc_handle_key = NULL;
     ShibTargetConfig* g_Config = NULL;
 }
 
@@ -90,14 +89,6 @@ static command_rec shibrm_cmds[] = {
   {NULL}
 };
 
-namespace {
-    void destroy_handle(void* data)
-    {
-        delete (RPCHandle*)data;
-    }
-}
-
-
 /* 
  * shibrm_child_init()
  *  Things to do when the child process is initialized.
@@ -124,9 +115,6 @@ extern "C" void shibrm_child_init(server_rec* s, pool* p)
   
     saml::NDC ndc("shibrm_child_init");
 
-    // Create the RPC Handle TLS key.
-    rpc_handle_key=ThreadKey::create(destroy_handle);
-
     ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,s,"shibrm_child_init() done");
 }
 
@@ -137,7 +125,6 @@ extern "C" void shibrm_child_init(server_rec* s, pool* p)
  */
 extern "C" void shibrm_child_exit(server_rec* s, pool* p)
 {
-    delete rpc_handle_key;
     g_Config->shutdown();
     g_Config = NULL;
     ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,s,"shibrm_child_exit() done");
@@ -271,14 +258,7 @@ extern "C" int shibrm_check_auth(request_rec* r)
     has_tag = ini.get_tag (application_id, "checkIPAddress", true, &tag);
     dc->config.checkIPAddress = (has_tag ? ShibINI::boolean (tag) : false);
 
-    // Get an RPC handle and build the RM object.
-    RPCHandle* rpc_handle = (RPCHandle*)rpc_handle_key->getData();
-    if (!rpc_handle)
-    {
-        rpc_handle = new RPCHandle(shib_target_sockname(), SHIBRPC_PROG, SHIBRPC_VERS_1);
-        rpc_handle_key->setData(rpc_handle);
-    }
-    RM rm(rpc_handle, dc->config);
+    RM rm(dc->config);
 
     vector<SAMLAssertion*> assertions;
     SAMLAuthenticationStatement* sso_statement=NULL;
index 4455b72..7e7204c 100644 (file)
@@ -40,7 +40,6 @@ extern "C" module MODULE_VAR_EXPORT shire_module;
 namespace {
     char* g_szSHIREURL = NULL;
     char* g_szSHIREConfig = NULL;
-    ThreadKey* rpc_handle_key = NULL;
     ShibTargetConfig* g_Config = NULL;
 }
 
@@ -121,13 +120,6 @@ static command_rec shire_cmds[] = {
   {NULL}
 };
 
-namespace {
-    void destroy_handle(void* data)
-    {
-        delete (RPCHandle*)data;
-    }
-}
-
 /* 
  * shire_child_init()
  *  Things to do when the child process is initialized.
@@ -153,9 +145,6 @@ extern "C" void shire_child_init(server_rec* s, pool* p)
       exit (1);
     }
 
-    // Create the RPC Handle TLS key.
-    rpc_handle_key=ThreadKey::create(destroy_handle);
-
     ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,s,"shire_child_init() done");
 }
 
@@ -166,7 +155,6 @@ extern "C" void shire_child_init(server_rec* s, pool* p)
  */
 extern "C" void shire_child_exit(server_rec* s, pool* p)
 {
-    delete rpc_handle_key;
     g_Config->shutdown();
     g_Config = NULL;
     ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,s,"shire_child_exit() done");
@@ -330,14 +318,7 @@ extern "C" int shire_check_user(request_rec* r)
       return SERVER_ERROR;
     }
     
-    // Get an RPC handle and build the SHIRE object.
-    RPCHandle* rpc_handle = (RPCHandle*)rpc_handle_key->getData();
-    if (!rpc_handle)
-    {
-        rpc_handle = new RPCHandle(shib_target_sockname(), SHIBRPC_PROG, SHIBRPC_VERS_1);
-        rpc_handle_key->setData(rpc_handle);
-    }
-    SHIRE shire(rpc_handle, dc->config, unescaped_shire);
+    SHIRE shire(dc->config, unescaped_shire);
 
     // We're in charge, so check for cookie.
     const char* session_id=NULL;
@@ -491,14 +472,7 @@ extern "C" int shire_post_handler (request_rec* r)
   markupProcessor.insert("logoLocation", has_tag ? tag : "");
   markupProcessor.insert("requestURL", targeturl);
   
-    // Get an RPC handle and build the SHIRE object.
-    RPCHandle* rpc_handle = (RPCHandle*)rpc_handle_key->getData();
-    if (!rpc_handle)
-    {
-        rpc_handle = new RPCHandle(shib_target_sockname(), SHIBRPC_PROG, SHIBRPC_VERS_1);
-        rpc_handle_key->setData(rpc_handle);
-    }
-    SHIRE shire(rpc_handle, config, unescaped_shire);
+    SHIRE shire(config, unescaped_shire);
 
   // Process SHIRE POST