# HG changeset patch # User Sebastien Decugis # Date 1284448492 -32400 # Node ID b0f9b0e1b564f00fa6785ecfe5064065e116b755 # Parent a0e3af6f94fbced154ab5bf67153c6a922c82fce Fix invalid initialization diff -r a0e3af6f94fb -r b0f9b0e1b564 extensions/app_radgw/rgw_clients.c --- 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;