llcache: Abort cleanly if called back during shutdown

In order to help us debug shutting down with active fetches, this
will abort the process cleanly if we get a callback to an "active"
llcache handle after the abort process has actually killed them
all.  This can happen with deferred fetcher aborts in the cURL
fetcher.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-06-15 21:13:09 +01:00
parent 09fa61eb73
commit 659c9161ee

View File

@ -2762,6 +2762,13 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
llcache_object *object = p;
llcache_event event;
if (llcache == NULL) {
NSLOG(llcache, CRITICAL, "Callback happened after llcache finalisation");
assert(false);
/* In case assertions are off, return here */
return;
}
NSLOG(llcache, DEBUG, "Fetch event %d for %p", msg->type, object);
switch (msg->type) {