2 Copyright (c) 2003-2006 by Juliusz Chroboczek
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 #include <sys/param.h>
29 #ifdef __MINGW32_VERSION
48 #include <sys/socket.h>
49 #include <netinet/in.h>
50 #include <netinet/tcp.h>
51 #include <arpa/inet.h>
53 #include <sys/types.h>
57 #include <sys/ioctl.h>
62 #define MAP_ANONYMOUS MAP_ANON
65 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
67 #elif defined(__GNUC__)
68 #define inline __inline
70 #define restrict __restrict
79 #if defined(__GNUC__) && (__GNUC__ >= 3)
80 #define ATTRIBUTE(x) __attribute__(x)
82 #define ATTRIBUTE(x) /**/
86 #define HAVE_TM_GMTOFF
95 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
100 #if defined(__linux__) && (__GNU_LIBRARY__ == 1)
107 #define HAVE_TM_GMTOFF
114 #define HAVE_ASPRINTF
123 #if _POSIX_VERSION >= 200112L
130 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
136 #define HAVE_ASPRINTF
137 #if __FreeBSD_version >= 400000
144 #if __NetBSD_Version__ >= 105000000
147 #if __NetBSD_Version__ >= 200000000
149 #define HAVE_ASPRINTF
154 #if OpenBSD >= 200311
161 #if defined(i386) || defined(__mc68020__)
162 #define UNALIGNED_ACCESS
170 #define HAVE_READV_WRITEV
172 #define READ(x, y, z) read(x, y, z)
173 #define WRITE(x, y, z) write(x, y, z)
174 #define CLOSE(x) close(x)
181 #ifdef HAVE_READV_WRITEV
182 #define WRITEV(x, y, z) writev(x, y, z)
183 #define READV(x, y, z) readv(x, y, z)
187 #define NO_REDIRECTOR
192 #include "ftsimport.h"
205 #include "diskcache.h"
207 #include "http_parse.h"
208 #include "parse_time.h"
209 #include "forbidden.h"
214 extern AtomPtr configFile
;
215 extern int daemonise
;
216 extern AtomPtr pidFile
;