mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Cleanup: Formating
This commit is contained in:
parent
73f00d5934
commit
6f6499a187
23
src/xslt.c
23
src/xslt.c
@ -152,23 +152,20 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
|
|||||||
int empty = -1;
|
int empty = -1;
|
||||||
struct stat file;
|
struct stat file;
|
||||||
|
|
||||||
if(stat(fn, &file)) {
|
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));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i = 0; i < CACHESIZE; i++) {
|
for ( i = 0; i < CACHESIZE; i++) {
|
||||||
if(cache[i].filename)
|
if(cache[i].filename) {
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if(!stricmp(fn, cache[i].filename))
|
if(!stricmp(fn, cache[i].filename)) {
|
||||||
#else
|
#else
|
||||||
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)
|
|
||||||
{
|
|
||||||
xsltFreeStylesheet(cache[i].stylesheet);
|
xsltFreeStylesheet(cache[i].stylesheet);
|
||||||
|
|
||||||
cache[i].last_modified = file.st_mtime;
|
cache[i].last_modified = file.st_mtime;
|
||||||
@ -178,20 +175,22 @@ static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
|
|||||||
ICECAST_LOG_DEBUG("Using cached sheet %i", i);
|
ICECAST_LOG_DEBUG("Using cached sheet %i", i);
|
||||||
return cache[i].stylesheet;
|
return cache[i].stylesheet;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
empty = i;
|
empty = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(empty>=0)
|
if (empty >= 0) {
|
||||||
i = empty;
|
i = empty;
|
||||||
else
|
} else {
|
||||||
i = evict_cache_entry();
|
i = evict_cache_entry();
|
||||||
|
}
|
||||||
|
|
||||||
cache[i].last_modified = file.st_mtime;
|
cache[i].last_modified = file.st_mtime;
|
||||||
cache[i].filename = strdup(fn);
|
cache[i].filename = strdup(fn);
|
||||||
cache[i].stylesheet = xsltParseStylesheetFile(XMLSTR(fn));
|
cache[i].stylesheet = xsltParseStylesheetFile(XMLSTR(fn));
|
||||||
cache[i].cache_age = time(NULL);
|
cache[i].cache_age = time(NULL);
|
||||||
|
|
||||||
return cache[i].stylesheet;
|
return cache[i].stylesheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user