comparison src/timer.c @ 155:6749f6639924

Fix bug for STAILQ that fail to remove a node. The previous one should be re-linked to next of removed one. But, it is linked to the removed one. Fix it!
author Thinker K.F. Li <thinker@branda.to>
date Wed, 01 Oct 2008 14:46:08 +0800
parents c986e45c1e91
children c7e5b8779bb5
comparison
equal deleted inserted replaced
154:6ce68c1f7405 155:6749f6639924
59 59
60 last = NULL; 60 last = NULL;
61 for(visit = STAILQ_HEAD(tman->timers); 61 for(visit = STAILQ_HEAD(tman->timers);
62 visit != NULL; 62 visit != NULL;
63 visit = STAILQ_NEXT(mb_timer_t, next, visit)) { 63 visit = STAILQ_NEXT(mb_timer_t, next, visit)) {
64 if(MB_TIMEVAL_LATER(&visit->tmo, tmo)) 64 if(MB_TIMEVAL_LATER(&visit->tmo, tmo) ||
65 MB_TIMEVAL_EQ(&visit->tmo, tmo))
65 break; 66 break;
66 last = visit; 67 last = visit;
67 } 68 }
68 69
69 if(last == NULL) 70 if(last == NULL)