MCPcopy Create free account
hub / github.com/apache/trafficserver / prune_config

Function prune_config

plugins/regex_revalidate/regex_revalidate.cc:249–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249static bool
250prune_config(invalidate_t **i)
251{
252 invalidate_t *iptr, *ilast;
253 time_t now;
254 bool pruned = false;
255
256 now = time(nullptr);
257
258 if (*i) {
259 iptr = *i;
260 ilast = nullptr;
261 while (iptr) {
262 if (iptr->expiry <= now) {
263 Dbg(dbg_ctl, "Removing %s expiry: %jd type: %s now: %jd", iptr->regex_text, (intmax_t)iptr->expiry,
264 strForResult(iptr->new_result), (intmax_t)now);
265 if (ilast) {
266 ilast->next = iptr->next;
267 free_invalidate_t(iptr);
268 iptr = ilast->next;
269 } else {
270 *i = iptr->next;
271 free_invalidate_t(iptr);
272 iptr = *i;
273 }
274 pruned = true;
275 } else {
276 ilast = iptr;
277 iptr = iptr->next;
278 }
279 }
280 }
281 return pruned;
282}
283
284static bool
285load_state(plugin_state_t *pstate, invalidate_t **ilist)

Callers 1

config_handlerFunction · 0.85

Calls 2

strForResultFunction · 0.85
free_invalidate_tFunction · 0.85

Tested by

no test coverage detected