lighttpd 1.4.x https://www.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

134 lines
3.2 KiB

#ifndef _LIGHTTPD_SETTINGS_H_
#define _LIGHTTPD_SETTINGS_H_
#include "first.h"
#ifdef __GNUC__
# define LI_NORETURN __attribute__((noreturn))
#else
# define LI_NORETURN
#endif
#define UNUSED(x) ( (void)(x) )
#define BV(x) (1 << x)
#define FILE_CACHE_MAX 16
/**
* max size of a buffer which will just be reset
* to ->used = 0 instead of really freeing the buffer
*
* 64kB (no real reason, just a guess)
*/
#define BUFFER_MAX_REUSE_SIZE (4 * 1024)
/* both should be way smaller than SSIZE_MAX :) */
#define MAX_READ_LIMIT (256*1024)
#define MAX_WRITE_LIMIT (256*1024)
/**
* max size of the HTTP request header
*
* 32k should be enough for everything (just a guess)
*
*/
#define MAX_HTTP_REQUEST_HEADER (32 * 1024)
typedef enum { HANDLER_UNSET,
HANDLER_GO_ON,
HANDLER_FINISHED,
HANDLER_COMEBACK,
HANDLER_WAIT_FOR_EVENT,
HANDLER_ERROR,
HANDLER_WAIT_FOR_FD
} handler_t;
#define HTTP_LINGER_TIMEOUT 5
#ifndef __sgi
/* IRIX doesn't like the alarm based time() optimization */
/* #define USE_ALARM */
#endif
/* select event-systems */
#if defined(HAVE_EPOLL_CTL) && defined(HAVE_SYS_EPOLL_H)
# define USE_LINUX_EPOLL
#endif
/* MacOS 10.3.x has poll.h under /usr/include/, all other unixes
* under /usr/include/sys/ */
#if defined(HAVE_POLL) && (defined(HAVE_SYS_POLL_H) || defined(HAVE_POLL_H))
# define USE_POLL
#endif
#if defined(HAVE_SELECT)
# define USE_SELECT
#endif
#if defined(HAVE_SYS_DEVPOLL_H) && defined(__sun)
# define USE_SOLARIS_DEVPOLL
#endif
#if defined(HAVE_PORT_H) && defined(HAVE_PORT_CREATE) && defined(__sun)
# define USE_SOLARIS_PORT
#endif
#if defined(HAVE_SYS_EVENT_H) && defined(HAVE_KQUEUE)
# define USE_FREEBSD_KQUEUE
#endif
/* sendfile/writev/mmap */
/* on linux 2.4.x you get either sendfile or LFS */
#if defined(HAVE_SYS_SENDFILE_H) && defined(HAVE_SENDFILE) && (!defined(_LARGEFILE_SOURCE) || defined(HAVE_SENDFILE64)) && defined(__linux__) && !defined(HAVE_SENDFILE_BROKEN)
# if defined(USE_SENDFILE)
# error "can't have more than one sendfile implementation"
# endif
# define USE_SENDFILE "linux-sendfile"
# define USE_LINUX_SENDFILE
#endif
#if defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__DragonFly__))
# if defined(USE_SENDFILE)
# error "can't have more than one sendfile implementation"
# endif
# define USE_SENDFILE "freebsd-sendfile"
# define USE_FREEBSD_SENDFILE
#endif
#if defined(HAVE_SENDFILE) && defined(__APPLE__)
# if defined(USE_SENDFILE)
# error "can't have more than one sendfile implementation"
# endif
# define USE_SENDFILE "darwin-sendfile"
# define USE_DARWIN_SENDFILE
#endif
#if defined(HAVE_SYS_SENDFILE_H) && defined(HAVE_SENDFILEV) && defined(__sun)
# if defined(USE_SENDFILE)
# error "can't have more than one sendfile implementation"
# endif
# define USE_SENDFILE "solaris-sendfilev"
# define USE_SOLARIS_SENDFILEV
#endif
/* not supported so far
#if defined(HAVE_SEND_FILE) && defined(__aix)
# if defined(USE_SENDFILE)
# error "can't have more than one sendfile implementation"
# endif
# define USE_SENDFILE "aix-sendfile"
# define USE_AIX_SENDFILE
#endif
*/
#if defined(HAVE_SYS_UIO_H) && defined(HAVE_WRITEV)
# define USE_WRITEV
#endif
#if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MMAP) && defined(ENABLE_MMAP)
# define USE_MMAP
#endif
#endif