SCMutex frag_pool_lock;
time_t timeout; /**< Default timeout. */
+ time_t last_timeouted; /**< time of last cleaning */
} DefragContext;
/**
dc->timeout = timeout;
}
+ dc->last_timeouted = 0;
+
SCLogDebug("Defrag Initialized:");
SCLogDebug("\tTimeout: %"PRIuMAX, (uintmax_t)dc->timeout);
SCLogDebug("\tMaximum defrag trackers: %"PRIuMAX, tracker_pool_size);
{
HashListTableBucket *next = HashListTableGetListHead(dc->frag_table);
DefragTracker *tracker;
+ struct timeval ts;
+
+ TimeGet(&ts);
+ /* If last cleaning was made in the current second, we leave */
+ if (dc->last_timeouted >= ts.tv_sec) {
+ return;
+ } else {
+ dc->last_timeouted = ts.tv_sec;
+ }
while (next != NULL) {
tracker = HashListTableGetListData(next);