defrag: don't return after a cleaning.

This patch changes the policy of the timeout function by cleaning
every timeouted trackers.
Previous code was only freeing the first tracker and this was resulting
in calling the timeout function continuously. One of my previous patch
has modified the function to avoid to run it more than twice a second.
But as it was not taken into account the fact only the first tracker was
freed, the result was that a lot of tracker could not be allocated.
pull/69/head
Eric Leblond 14 years ago
parent b6834cb6b2
commit 937ba71491

@ -1012,10 +1012,10 @@ done:
} }
/** /**
* \brief Timeout a tracker. * \brief Timeout trackers.
* *
* Called when we fail to get a tracker from the pool. The first * Called when we fail to get a tracker from the pool. The trackers
* tracker that has expired will be released back to the pool then the * that has expired will be released back to the pool then the
* function will exit. * function will exit.
* *
* Intended to be called with the tracker pool already locked. * Intended to be called with the tracker pool already locked.
@ -1040,6 +1040,7 @@ DefragTimeoutTracker(ThreadVars *tv, DecodeThreadVars *dtv, DefragContext *dc,
} }
while (next != NULL) { while (next != NULL) {
tracker = HashListTableGetListData(next); tracker = HashListTableGetListData(next);
next = HashListTableGetListNext(next);
if (tracker->timeout < (unsigned int)p->ts.tv_sec) { if (tracker->timeout < (unsigned int)p->ts.tv_sec) {
int af_family = tracker->af; int af_family = tracker->af;
@ -1057,10 +1058,7 @@ DefragTimeoutTracker(ThreadVars *tv, DecodeThreadVars *dtv, DefragContext *dc,
tv->sc_perf_pca); tv->sc_perf_pca);
} }
} }
return;
} }
next = HashListTableGetListNext(next);
} }
} }

Loading…
Cancel
Save