-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
64 lines (47 loc) · 2.13 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright 2006-2017 Niklas Edmundsson <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _CACHE_CONFIG_H
#define _CACHE_CONFIG_H
/* Check status every N iterations while copying a file */
#define CPCHKINTERVAL 20
#define CPBUFSIZE 262144
/* Size of window to flush when writing */
#define CACHE_WRITE_FLUSH_WINDOW 8388608
#define CACHE_UPDATE_TIMEOUT 30 /* Note! In seconds! */
/* Breakpoint between copying while file before serving it, or dispatch
copying to copyd and do read-while-caching */
#define MAX_COPY_SIZE (30*1024*1024) /* in bytes */
#define DIRLENGTH 1
#define DIRLEVELS 2
#define CACHE_BODY_SUFFIX ".body"
/* How long to sleep between retries while looping and waiting for either
a file or data in file when doing read-while-caching. */
#define CACHE_LOOP_SLEEP 50 /* in ms, lower than 1s */
#ifdef USE_COPYD
#define CACHE_MAXFD 32768
#endif
#define COPYD_USER "www-ftp"
#define SOCKPATH "/run/.cachecopyd.sock"
static const char backend_root[] = "/export/ftp/";
static const int backend_len = sizeof(backend_root)-1;
static const char cache_root[] = "/httpcache/";
static const int cache_len = sizeof(cache_root)-1;
/* Breakpoint for large files to be put in different cache hierarchy.
If used together with redirprg, keep in sync with minredirsize. */
#define CACHE_BF_SIZE 4194304
static const char bfcache_root[] = "/httpcachebf/";
static const int bfcache_len = sizeof(bfcache_root)-1;
#endif /* _CACHE_CONFIG_H */