forked from ltworf/weborf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.h.in
123 lines (97 loc) · 4.29 KB
/
options.h.in
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
Weborf
Copyright (C) 2007-2019 Salvo "LtWorf" Tomaselli
Weborf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
*/
#include "config.h"
#include <unistd.h> //Needed because it defines the _POSIX_IPV6
#ifndef WEBORF_OPTIONS_H
#define WEBORF_OPTIONS_H
#define NAME "WebList"
//#define VERSION PACKAGE_VERSION
#define SIGNATURE NAME "/" VERSION " (GNU/Linux)"
//----------Network
#define MAXQ 64 //Queue for connect requests
#define PORT "8080" //Default port
#ifdef _POSIX_IPV6 //Enables ipv6 if supported
//Delete the following line to use IPv4 instead.
#define IPV6
#endif
#ifdef IPV6
#define IPVERSION '6'
#else
#define IPVERSION '4'
#endif
//-----------Threads
#define MAXTHREAD 300 //Max threads
#define INITIALTHREAD 6 //Thread started when free threads are low and when starting
#define LOWTHREAD 3 //Minimum number of free threads, before starting new ones
#define MAXFREETHREAD 6 //Maximum number of free threads, before starting to slowly close them
#define THREADCONTROL 10 //Polling frequence in seconds
//------------Server
#define INDEX "index.html" //Default index file that weborf will search
#define BASEDIR "/mnt" //Default basedir
#define READ_TIMEOUT 6000 //Timeout before closing inactive keep-alive connections, in milliseconds
//------------Buffers
#define INBUFFER 1024 //Size for buffer with the HTTP request
#define FILEBUF 4096 //Size of reads
#define MAXSCRIPTOUT 512000 //Maximum size for a page generated by a script or internally
#define HEADBUF 1024 //Buffer for headers
#define PWDLIMIT 300 //Max size for password
#define INDEXMAXLEN 30
#define NBUFFER 15 //Buffer to contain the string representation of an integer
#define RBUFFER 128 //Buffer to contain a range
#define BUFFERED_READER_SIZE 2048
#define DATEBUFFER 50 //Buffer for text date
#define URI_LEN 256
#define ESCAPED_FNAME_LEN 256 * 3 //To contain escaped filenames, d_name size is 256 on linux
#define PATH_LEN 1024
#define MIMETYPELEN 15 //Size of mimetype string
//Number of index pages allowed to search
#define MAXINDEXCOUNT 10
//-------------LIMITS
#define POST_MAX_SIZE 2000000 //Maximum allowed size for POST data
//-------------HTML
#define CSS_PAGE "/.style.css"
#define HTMLHEAD "<!DOCTYPE HTML>\n" \
"<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"><title>" NAME "</title> <link rel=\"stylesheet\" href=\"" CSS_PAGE "\"></head>" \
"<body><h2>" NAME "</h2><div>"
#define HTMLFOOT "</div><span>" SIGNATURE "</span></body></html>"
//-------------SCRIPTS
#define SCRPT_TIMEOUT 60 //Timeout for the scripts, in seconds
#define CGI_PHP "/usr/data/bin/php"
#define CGI_PY "/usr/data/bin/python"
//-------------COMPRESSING PAGES
//#define __COMPRESSION //enables support for compressing pages, comment to disable
#ifdef __COMPRESSION
#define SIZE_COMPRESS_MIN 512
#define SIZE_COMPRESS_MAX 4000000000
#define GZIPNICE 4 //Nice value for gzip process
#endif
//The following header can be disabled to increase a little the speed
//#define SEND_LAST_MODIFIED_HEADER
#define SEND_MIMETYPES //Enables support to sending the mimetype to the client
#define MIME_DEFAULT "application/octet-stream"
//-------------RANGE
#define __RANGE //Enables support to range (partial download)
//-------------WEBDAV
#define WEBDAV //Enables webdav support
#define MAXPROPCOUNT 100 //Number of supported properties
//-------------Logging options
#define THREADDBG
#define SOCKETDBG
#define SENDINGDBG
#define SERVERDBG
#define REQUESTDBG
#define EMBEDDED_AUTH
#endif