From 6dcb68abb0632348743d8da720922d637a661613 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Fri, 9 Sep 2011 21:52:52 +0530 Subject: [PATCH] update flow pruning - v2 --- src/flow.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/flow.c b/src/flow.c index 496ac429aa..6285992f01 100644 --- a/src/flow.c +++ b/src/flow.c @@ -533,9 +533,6 @@ static int FlowPrune(ThreadVars *tv, FlowQueue *q, struct timeval *ts) goto FlowPrune_Prune_Next; } - /* unlock list */ - SCMutexUnlock(&q->mutex_q); - if (SCSpinTrylock(&f->fb->s) != 0) { SCMutexUnlock(&f->m); SCLogDebug("cant lock 2"); @@ -543,9 +540,13 @@ static int FlowPrune(ThreadVars *tv, FlowQueue *q, struct timeval *ts) #ifdef FLOW_PRUNE_DEBUG prune_bucket_lock++; #endif - return cnt; + f = f->lnext; + goto FlowPrune_Prune_Next; } + /* unlock list */ + SCMutexUnlock(&q->mutex_q); + /*set the timeout value according to the flow operating mode, flow's state and protocol.*/ uint32_t timeout = 0;