summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-06-15 21:13:09 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-06-15 21:13:09 +0100
commit659c9161ee037bb523891ac3e3b00748cec6289f (patch)
tree7643b35d223edbd96f70e7e18fed4a3613863b3b
parent09fa61eb737aa93fb2e99d383c46bcf35d5d730d (diff)
downloadnetsurf-659c9161ee037bb523891ac3e3b00748cec6289f.tar.gz
netsurf-659c9161ee037bb523891ac3e3b00748cec6289f.tar.bz2
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>
-rw-r--r--content/llcache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/llcache.c b/content/llcache.c
index 58ac00a7c..625e810ff 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -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) {