summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-02-01 04:07:41 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2023-05-03 23:11:34 -0400
commit88607b497ba67033321db459430d6f9d1cf33ee0 (patch)
treefe50bd69b3da68718ee9e3746dcdc97f40fbb2ae /src
parent06050c7d996559ab22e0284dac993597a7b0ee67 (diff)
downloadlighttpd-git-88607b497ba67033321db459430d6f9d1cf33ee0.tar.gz
[mod_deflate] _WIN32 disable deflate.cache-dir
_WIN32 disable deflate.cache-dir due to NTFS filesystem limitations deflate.cache-dir renames files into place and this fails if the files are open (source or destination). deflate.cache-dir would have to be reworked to fail gracefully and continue serving request if the final rename fails.
Diffstat (limited to 'src')
-rw-r--r--src/mod_deflate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mod_deflate.c b/src/mod_deflate.c
index 484036c8..9a6f72f3 100644
--- a/src/mod_deflate.c
+++ b/src/mod_deflate.c
@@ -304,11 +304,13 @@ static int mkdir_for_file (char *fn) {
return 0;
}
+#ifndef _WIN32 /* disable on _WIN32 */
static int mkdir_recursive (char *dir) {
return 0 == mkdir_for_file(dir) && (0 == mkdir(dir,0700) || errno == EEXIST)
? 0
: -1;
}
+#endif
static buffer * mod_deflate_cache_file_name(request_st * const r, const buffer *cache_dir, const buffer * const etag) {
/* XXX: future: for shorter paths into the cache, we could checksum path,
@@ -384,7 +386,9 @@ static void mod_deflate_merge_config_cpv(plugin_config * const pconf, const conf
pconf->max_loadavg = cpv->v.d;
break;
case 8: /* deflate.cache-dir */
+ #ifndef _WIN32 /* disable on _WIN32 */
pconf->cache_dir = cpv->v.b;
+ #endif
break;
#if 0 /*(cpv->k_id remapped in mod_deflate_set_defaults())*/
case 9: /* compress.filetype */
@@ -798,6 +802,7 @@ SETDEFAULTS_FUNC(mod_deflate_set_defaults) {
cpv->k_id = 8; /* deflate.cache-dir */
__attribute_fallthrough__
case 8: /* deflate.cache-dir */
+ #ifndef _WIN32 /* disable on _WIN32 */
if (!buffer_is_blank(cpv->v.b)) {
buffer *b;
*(const buffer **)&b = cpv->v.b;
@@ -812,6 +817,7 @@ SETDEFAULTS_FUNC(mod_deflate_set_defaults) {
}
}
else
+ #endif
cpv->v.b = NULL;
break;
#if 0 /*(handled further above)*/