From 892592fe13ed55c6b8a89a6659b6ea0e4e066046 Mon Sep 17 00:00:00 2001 From: olavmrk Date: Wed, 18 May 2011 10:49:08 +0000 Subject: Change cfg->idp_metadata_files to an array instead of an hash. git-svn-id: https://modmellon.googlecode.com/svn/trunk@126 a716ebb1-153a-0410-b759-cfb97c6a1b53 --- auth_mellon_handler.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'auth_mellon_handler.c') diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c index c0379e8..c3284c3 100644 --- a/auth_mellon_handler.c +++ b/auth_mellon_handler.c @@ -216,33 +216,27 @@ static int am_server_add_providers(request_rec *r) am_dir_cfg_rec *cfg = am_get_dir_cfg(r); const char *idp_metadata_file; const char *idp_public_key_file; - apr_hash_index_t *index; + apr_size_t index; int count = 0; - if (apr_hash_count(cfg->idp_metadata_files) == 1) + if (cfg->idp_metadata_files->nelts == 1) idp_public_key_file = cfg->idp_public_key_file; else idp_public_key_file = NULL; - for (index = apr_hash_first(r->pool, cfg->idp_metadata_files); - index; - index = apr_hash_next(index)) { - const char *idp_provider_id; - apr_ssize_t len; + for (index = 0; index < cfg->idp_metadata_files->nelts; index++) { int ret; - - apr_hash_this(index, (const void **)&idp_provider_id, - &len, (void *)&idp_metadata_file); + idp_metadata_file = APR_ARRAY_IDX(cfg->idp_metadata_files, index, + const char *); - ret = lasso_server_add_provider(cfg->server, LASSO_PROVIDER_ROLE_IDP, idp_metadata_file, idp_public_key_file, cfg->idp_ca_file); if (ret != 0) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "Error adding IdP \"%s\" to lasso server object.", - idp_provider_id); + "Error adding IdP from \"%s\" to lasso server object.", + idp_metadata_file); } else { count++; } -- cgit