// 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,
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.
extern "C" BOOL WINAPI TerminateFilter(DWORD)
{
- delete rpc_handle_key;
if (g_Config)
g_Config->shutdown();
g_Config = NULL;
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;
// 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;
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))
using namespace shibtarget;
namespace {
- ThreadKey* rpc_handle_key = NULL;
ShibTargetConfig* g_Config = NULL;
}
{NULL}
};
-namespace {
- void destroy_handle(void* data)
- {
- delete (RPCHandle*)data;
- }
-}
-
-
/*
* shibrm_child_init()
* Things to do when the child process is initialized.
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");
}
*/
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");
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;
namespace {
char* g_szSHIREURL = NULL;
char* g_szSHIREConfig = NULL;
- ThreadKey* rpc_handle_key = NULL;
ShibTargetConfig* g_Config = NULL;
}
{NULL}
};
-namespace {
- void destroy_handle(void* data)
- {
- delete (RPCHandle*)data;
- }
-}
-
/*
* shire_child_init()
* Things to do when the child process is initialized.
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");
}
*/
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");
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;
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