summaryrefslogtreecommitdiffstats
path: root/auth_mellon_handler.c
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-05-18 10:49:32 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-05-18 10:49:32 +0000
commit83de18800f9cea18b1ccf7889cb4499f141525d0 (patch)
tree0bb460ed89462b0b89d326b31f179e8cce3b8ba4 /auth_mellon_handler.c
parent72ae1cf68711a31ec62e27e8854b2100c8931c7e (diff)
downloadmod_auth_mellon-83de18800f9cea18b1ccf7889cb4499f141525d0.tar.gz
mod_auth_mellon-83de18800f9cea18b1ccf7889cb4499f141525d0.tar.xz
mod_auth_mellon-83de18800f9cea18b1ccf7889cb4499f141525d0.zip
Add support for inheriting lasso_server objects.
Change configuration to inherit the lasso_server objects when nothing affecting the lasso_server object changes from the parent configuration object. This should speed up processing of requests where you have request-specific configuration changes, such as access control rules. git-svn-id: https://modmellon.googlecode.com/svn/trunk@130 a716ebb1-153a-0410-b759-cfb97c6a1b53
Diffstat (limited to 'auth_mellon_handler.c')
-rw-r--r--auth_mellon_handler.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index 5694f88..4f79d3a 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -206,14 +206,14 @@ static char *am_generate_metadata(apr_pool_t *p, request_rec *r)
* This function loads all IdP metadata in a lasso server
*
* Parameters:
+ * am_dir_cfg_rec *cfg The server configuration.
* request_rec *r The request we received.
*
* Returns:
* number of loaded providers
*/
-static guint am_server_add_providers(request_rec *r)
+static guint am_server_add_providers(am_dir_cfg_rec *cfg, request_rec *r)
{
- am_dir_cfg_rec *cfg = am_get_dir_cfg(r);
const char *idp_public_key_file;
apr_size_t index;
@@ -276,6 +276,8 @@ static LassoServer *am_get_lasso_server(request_rec *r)
{
am_dir_cfg_rec *cfg = am_get_dir_cfg(r);
+ cfg = cfg->inherit_server_from;
+
apr_thread_mutex_lock(cfg->server_mutex);
if(cfg->server == NULL) {
if(cfg->sp_metadata_file == NULL) {
@@ -308,7 +310,7 @@ static LassoServer *am_get_lasso_server(request_rec *r)
return NULL;
}
- if (am_server_add_providers(r) == 0) {
+ if (am_server_add_providers(cfg, r) == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Error adding IdP to lasso server object. Please"
" verify the following configuration directives:"
@@ -2265,6 +2267,8 @@ static int am_handle_metadata(request_rec *r)
if(server == NULL)
return HTTP_INTERNAL_SERVER_ERROR;
+ cfg = cfg->inherit_server_from;
+
data = cfg->sp_metadata_file;
if (data == NULL)
return HTTP_INTERNAL_SERVER_ERROR;