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/mod_mellon2@137 a716ebb1-153a-0410-b759-cfb97c6a1b53
This commit is contained in:
olavmrk 2011-09-23 11:27:43 +00:00
parent bd75567ca2
commit 624e77012b
1 changed files with 14 additions and 7 deletions

View File

@ -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