Commit 3ffe5f4e authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Adding more debugging to XSLT cache

parent e9140588
Pipeline #244 failed with stage
in 12 seconds
...@@ -152,6 +152,8 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { ...@@ -152,6 +152,8 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
int empty = -1; int empty = -1;
struct stat file; struct stat file;
ICECAST_LOG_DEBUG("Looking up stylesheet file \"%s\".", fn);
if (stat(fn, &file) != 0) { if (stat(fn, &file) != 0) {
ICECAST_LOG_WARN("Error checking for stylesheet file \"%s\": %s", fn, ICECAST_LOG_WARN("Error checking for stylesheet file \"%s\": %s", fn,
strerror(errno)); strerror(errno));
...@@ -166,6 +168,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { ...@@ -166,6 +168,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
if(!strcmp(fn, cache[i].filename)) { if(!strcmp(fn, cache[i].filename)) {
#endif #endif
if(file.st_mtime > cache[i].last_modified) { 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); xsltFreeStylesheet(cache[i].stylesheet);
cache[i].last_modified = file.st_mtime; cache[i].last_modified = file.st_mtime;
...@@ -182,8 +185,10 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) { ...@@ -182,8 +185,10 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
if (empty >= 0) { if (empty >= 0) {
i = empty; i = empty;
ICECAST_LOG_DEBUG("Using empty slot %i", i);
} else { } else {
i = evict_cache_entry(); i = evict_cache_entry();
ICECAST_LOG_DEBUG("Using evicted slot %i", i);
} }
cache[i].last_modified = file.st_mtime; cache[i].last_modified = file.st_mtime;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment