Mercurial > hg > freeDiameter
changeset 545:b0f9b0e1b564
Fix invalid initialization
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 14 Sep 2010 16:14:52 +0900 |
parents | a0e3af6f94fb |
children | 0790fcf2fbfc |
files | extensions/app_radgw/rgw_clients.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/extensions/app_radgw/rgw_clients.c Tue Sep 14 16:04:59 2010 +0900 +++ b/extensions/app_radgw/rgw_clients.c Tue Sep 14 16:14:52 2010 +0900 @@ -136,11 +136,15 @@ /* The core of the purge thread */ static int dupl_purge_list(struct fd_list * clients) { + struct fd_list *li = NULL; + for (li = clients->next; li != clients; li = li->next) { struct rgw_client * client = (struct rgw_client *)li; int p; + for (p=0; p<=1; p++) { + /* Lock this list */ time_t now; CHECK_POSIX( pthread_mutex_lock(&client->dupl_info[p].dupl_lock) ); @@ -148,6 +152,7 @@ now = time(NULL); while (!FD_IS_LIST_EMPTY(&client->dupl_info[p].dupl_by_time)) { + /* Check the first item in the list */ struct req_info * r = (struct req_info *)(client->dupl_info[p].dupl_by_time.next->o); @@ -227,9 +232,9 @@ /* Initialize the duplicate list info */ for (i=0; i<=1; i++) { - CHECK_POSIX( pthread_mutex_init(&tmp->dupl_info[0].dupl_lock, NULL) ); - fd_list_init(&tmp->dupl_info[0].dupl_by_id, NULL); - fd_list_init(&tmp->dupl_info[0].dupl_by_time, NULL); + CHECK_POSIX( pthread_mutex_init(&tmp->dupl_info[i].dupl_lock, NULL) ); + fd_list_init(&tmp->dupl_info[i].dupl_by_id, NULL); + fd_list_init(&tmp->dupl_info[i].dupl_by_time, NULL); } tmp->type = type;