From 3ffe5f4e969e2399c5e8a8471d2be4622a800486 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Fri, 6 Jul 2018 20:37:18 +0000 Subject: [PATCH] Update: Adding more debugging to XSLT cache --- src/xslt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xslt.c b/src/xslt.c index ad529a7a..c157f68f 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -152,6 +152,8 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { int empty = -1; struct stat file; + ICECAST_LOG_DEBUG("Looking up stylesheet file \"%s\".", fn); + if (stat(fn, &file) != 0) { ICECAST_LOG_WARN("Error checking for stylesheet file \"%s\": %s", fn, strerror(errno)); @@ -166,6 +168,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { if(!strcmp(fn, cache[i].filename)) { #endif if(file.st_mtime > cache[i].last_modified) { + ICECAST_LOG_DEBUG("Source file newer than cached copy. Reloading slot %i", i); xsltFreeStylesheet(cache[i].stylesheet); cache[i].last_modified = file.st_mtime; @@ -182,8 +185,10 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { if (empty >= 0) { i = empty; + ICECAST_LOG_DEBUG("Using empty slot %i", i); } else { i = evict_cache_entry(); + ICECAST_LOG_DEBUG("Using evicted slot %i", i); } cache[i].last_modified = file.st_mtime;