Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv7921/src
Modified Files:
Tag: rel-1_0
gline.c
Log Message:
fix overzealous expiration of glines
Index: gline.c
===================================================================
RCS file: /cvsroot/srvx/services/src/gline.c,v
retrieving revision 1.6.2.9
retrieving revision 1.6.2.10
diff -C2 -r1.6.2.9 -r1.6.2.10
*** gline.c 2001/08/22 04:28:24 1.6.2.9
--- gline.c 2001/08/23 01:50:25 1.6.2.10
***************
*** 91,108 ****
gline_expire(void *data)
{
! void *argh, *wraa;
(void)data;
pthread_mutex_lock(&gline_mutex);
while (heap_size(gline_heap)) {
! heap_peek(gline_heap, &argh, &wraa);
! if (TIME_T_CAST(argh) <= now) {
! heap_pop(gline_heap);
! free_gline(wraa);
! }
}
! heap_peek(gline_heap, &argh, &wraa);
! if (wraa) {
! timeq_add(TIME_T_CAST(argh), gline_expire, NULL);
}
pthread_mutex_unlock(&gline_mutex);
--- 91,109 ----
gline_expire(void *data)
{
! time_t stopped;
! void *wraa;
(void)data;
pthread_mutex_lock(&gline_mutex);
+ stopped = 0;
while (heap_size(gline_heap)) {
! heap_peek(gline_heap, 0, &wraa);
! stopped = ((struct gline*)wraa)->expires;
! if (stopped > now) break;
! heap_pop(gline_heap);
! free_gline(wraa);
}
! if (heap_size(gline_heap)) {
! timeq_add(stopped, gline_expire, NULL);
}
pthread_mutex_unlock(&gline_mutex);
|