summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-09-23 11:27:43 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-09-23 11:27:43 +0000
commit2d6015d74ad9a09e08519ef2b9f4a00e1f9a6c5f (patch)
tree8f51f1b95d98ce85a530a0ab045d64a6e6eff045
parent9eb7a6a432cd69c16be624dda9a864fbc37b8b63 (diff)
downloadmod_auth_mellon-2d6015d74ad9a09e08519ef2b9f4a00e1f9a6c5f.tar.gz
mod_auth_mellon-2d6015d74ad9a09e08519ef2b9f4a00e1f9a6c5f.tar.xz
mod_auth_mellon-2d6015d74ad9a09e08519ef2b9f4a00e1f9a6c5f.zip
Avoid dependency on GLib 2.16.
We used GHashTableIter, which wasn't introduced before version 2.16 of GLib. This patch changes the code to simply use g_hash_table_get_keys instead. (This means that we depend on GLib 2.14.) git-svn-id: https://modmellon.googlecode.com/svn/trunk@137 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r--auth_mellon_handler.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index 985b123..ca3310e 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -342,16 +342,20 @@ static LassoServer *am_get_lasso_server(request_rec *r)
static const char *am_first_idp(request_rec *r)
{
LassoServer *server;
- GHashTableIter iter;
+ GList *idp_list;
const char *idp_providerid;
server = am_get_lasso_server(r);
if (server == NULL)
return NULL;
- g_hash_table_iter_init (&iter, server->providers);
- if (!g_hash_table_iter_next(&iter, (void**)&idp_providerid, NULL))
- return NULL;
+ idp_list = g_hash_table_get_keys(server->providers);
+ if (idp_list == NULL)
+ return NULL;
+
+ idp_providerid = idp_list->data;
+
+ g_list_free(idp_list);
return idp_providerid;
}
@@ -2586,7 +2590,8 @@ static int am_handle_probe_discovery(request_rec *r) {
LassoServer *server;
const char *idp = NULL;
int timeout;
- GHashTableIter iter;
+ GList *idp_list;
+ GList *iter;
char *return_to;
char *idp_param;
char *redirect_url;
@@ -2649,13 +2654,14 @@ static int am_handle_probe_discovery(request_rec *r) {
* The first to answer is chosen, but the list of usable
* IdP can be restricted in configuration.
*/
- g_hash_table_iter_init(&iter, server->providers);
- while (g_hash_table_iter_next(&iter, (void**)&idp, NULL)) {
+ idp_list = g_hash_table_get_keys(server->providers);
+ for (iter = idp_list; iter != NULL; iter = iter->next) {
void *dontcare;
const char *ping_url;
apr_size_t len;
long status;
+ idp = iter->data;
ping_url = idp;
/*
@@ -2692,6 +2698,7 @@ static int am_handle_probe_discovery(request_rec *r) {
"probeDiscovery using %s", idp);
break;
}
+ g_list_free(idp_list);
/*
* On failure, try default