version 1.1, 2013/10/14 10:32:47
|
version 1.1.1.3, 2016/11/02 10:35:00
|
Line 1
|
Line 1
|
#ifndef _BASE_H_ |
#ifndef _BASE_H_ |
#define _BASE_H_ |
#define _BASE_H_ |
|
#include "first.h" |
|
|
#ifdef HAVE_CONFIG_H |
|
# include "config.h" |
|
#endif |
|
#include "settings.h" |
#include "settings.h" |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
Line 32
|
Line 30
|
|
|
#if defined HAVE_LIBSSL && defined HAVE_OPENSSL_SSL_H |
#if defined HAVE_LIBSSL && defined HAVE_OPENSSL_SSL_H |
# define USE_OPENSSL |
# define USE_OPENSSL |
|
# include <openssl/opensslconf.h> |
|
# ifndef USE_OPENSSL_KERBEROS |
|
# ifndef OPENSSL_NO_KRB5 |
|
# define OPENSSL_NO_KRB5 |
|
# endif |
|
# endif |
# include <openssl/ssl.h> |
# include <openssl/ssl.h> |
# if ! defined OPENSSL_NO_TLSEXT && ! defined SSL_CTRL_SET_TLSEXT_HOSTNAME |
# if ! defined OPENSSL_NO_TLSEXT && ! defined SSL_CTRL_SET_TLSEXT_HOSTNAME |
# define OPENSSL_NO_TLSEXT |
# define OPENSSL_NO_TLSEXT |
Line 222 typedef struct {
|
Line 226 typedef struct {
|
|
|
#ifdef HAVE_FAM_H |
#ifdef HAVE_FAM_H |
int dir_version; |
int dir_version; |
int dir_ndx; |
|
#endif |
#endif |
|
|
buffer *content_type; |
buffer *content_type; |
Line 235 typedef struct {
|
Line 238 typedef struct {
|
#ifdef HAVE_FAM_H |
#ifdef HAVE_FAM_H |
splay_tree *dirs; /* the nodes of the tree are fam_dir_entry */ |
splay_tree *dirs; /* the nodes of the tree are fam_dir_entry */ |
|
|
FAMConnection *fam; | FAMConnection fam; |
int fam_fcce_ndx; |
int fam_fcce_ndx; |
#endif |
#endif |
buffer *hash_key; /* temp-store for the hash-key */ |
buffer *hash_key; /* temp-store for the hash-key */ |
Line 248 typedef struct {
|
Line 251 typedef struct {
|
buffer *document_root; |
buffer *document_root; |
buffer *server_name; |
buffer *server_name; |
buffer *error_handler; |
buffer *error_handler; |
|
buffer *error_handler_404; |
buffer *server_tag; |
buffer *server_tag; |
buffer *dirlist_encoding; |
buffer *dirlist_encoding; |
buffer *errorfile_prefix; |
buffer *errorfile_prefix; |
|
|
|
unsigned short high_precision_timestamps; |
unsigned short max_keep_alive_requests; |
unsigned short max_keep_alive_requests; |
unsigned short max_keep_alive_idle; |
unsigned short max_keep_alive_idle; |
unsigned short max_read_idle; |
unsigned short max_read_idle; |
Line 259 typedef struct {
|
Line 264 typedef struct {
|
unsigned short use_xattr; |
unsigned short use_xattr; |
unsigned short follow_symlink; |
unsigned short follow_symlink; |
unsigned short range_requests; |
unsigned short range_requests; |
|
unsigned short stream_request_body; |
|
unsigned short stream_response_body; |
|
|
/* debug */ |
/* debug */ |
|
|
Line 296 typedef struct {
|
Line 303 typedef struct {
|
unsigned short etag_use_mtime; |
unsigned short etag_use_mtime; |
unsigned short etag_use_size; |
unsigned short etag_use_size; |
unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */ |
unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */ |
|
unsigned int http_parseopts; |
unsigned int max_request_size; |
unsigned int max_request_size; |
|
int listen_backlog; |
|
|
unsigned short kbytes_per_second; /* connection kb/s limit */ |
unsigned short kbytes_per_second; /* connection kb/s limit */ |
|
|
Line 319 typedef struct {
|
Line 328 typedef struct {
|
*/ |
*/ |
off_t *global_bytes_per_second_cnt_ptr; /* */ |
off_t *global_bytes_per_second_cnt_ptr; /* */ |
|
|
|
#if defined(__FreeBSD__) || defined(__NetBSD__) \ |
|
|| defined(__OpenBSD__) || defined(__DragonflyBSD__) |
|
buffer *bsd_accept_filter; |
|
#endif |
|
|
#ifdef USE_OPENSSL |
#ifdef USE_OPENSSL |
SSL_CTX *ssl_ctx; | SSL_CTX *ssl_ctx; /* not patched */ |
| /* SNI per host: with COMP_SERVER_SOCKET, COMP_HTTP_SCHEME, COMP_HTTP_HOST */ |
| EVP_PKEY *ssl_pemfile_pkey; |
| X509 *ssl_pemfile_x509; |
| STACK_OF(X509_NAME) *ssl_ca_file_cert_names; |
#endif |
#endif |
} specific_config; |
} specific_config; |
|
|
Line 340 typedef enum {
|
Line 358 typedef enum {
|
CON_STATE_CLOSE |
CON_STATE_CLOSE |
} connection_state_t; |
} connection_state_t; |
|
|
typedef enum { COND_RESULT_UNSET, COND_RESULT_FALSE, COND_RESULT_TRUE } cond_result_t; | typedef enum { |
| /* condition not active at the moment because itself or some |
| * pre-condition depends on data not available yet |
| */ |
| COND_RESULT_UNSET, |
| |
| /* special "unset" for branches not selected due to pre-conditions |
| * not met (but pre-conditions are not "unset" anymore) |
| */ |
| COND_RESULT_SKIP, |
| |
| /* actually evaluated the condition itself */ |
| COND_RESULT_FALSE, /* not active */ |
| COND_RESULT_TRUE, /* active */ |
| } cond_result_t; |
| |
typedef struct { |
typedef struct { |
|
/* current result (with preconditions) */ |
cond_result_t result; |
cond_result_t result; |
|
/* result without preconditions (must never be "skip") */ |
|
cond_result_t local_result; |
int patterncount; |
int patterncount; |
int matches[3 * 10]; |
int matches[3 * 10]; |
buffer *comp_value; /* just a pointer */ |
buffer *comp_value; /* just a pointer */ |
|
|
comp_key_t comp_type; |
|
} cond_cache_t; |
} cond_cache_t; |
|
|
typedef struct { |
typedef struct { |
Line 360 typedef struct {
|
Line 394 typedef struct {
|
|
|
time_t connection_start; |
time_t connection_start; |
time_t request_start; |
time_t request_start; |
|
struct timespec request_start_hp; |
|
|
struct timeval start_tv; |
|
|
|
size_t request_count; /* number of requests handled in this connection */ |
size_t request_count; /* number of requests handled in this connection */ |
size_t loops_per_request; /* to catch endless loops in a single request |
size_t loops_per_request; /* to catch endless loops in a single request |
* |
* |
Line 428 typedef struct {
|
Line 461 typedef struct {
|
buffer *server_name; |
buffer *server_name; |
|
|
/* error-handler */ |
/* error-handler */ |
buffer *error_handler; |
|
int error_handler_saved_status; |
int error_handler_saved_status; |
int in_error_handler; | http_method_t error_handler_saved_method; |
|
|
struct server_socket *srv_socket; /* reference to the server-socket */ |
struct server_socket *srv_socket; /* reference to the server-socket */ |
|
|
Line 493 typedef struct {
|
Line 525 typedef struct {
|
buffer *breakagelog_file; |
buffer *breakagelog_file; |
|
|
unsigned short dont_daemonize; |
unsigned short dont_daemonize; |
|
unsigned short preflight_check; |
buffer *changeroot; |
buffer *changeroot; |
buffer *username; |
buffer *username; |
buffer *groupname; |
buffer *groupname; |
Line 505 typedef struct {
|
Line 538 typedef struct {
|
buffer *network_backend; |
buffer *network_backend; |
array *modules; |
array *modules; |
array *upload_tempdirs; |
array *upload_tempdirs; |
|
unsigned int upload_temp_file_size; |
|
|
unsigned short max_worker; |
unsigned short max_worker; |
unsigned short max_fds; |
unsigned short max_fds; |
unsigned short max_conns; |
unsigned short max_conns; |
unsigned int max_request_size; |
|
|
|
unsigned short log_request_header_on_error; |
unsigned short log_request_header_on_error; |
unsigned short log_state_handling; |
unsigned short log_state_handling; |
Line 523 typedef struct {
|
Line 556 typedef struct {
|
} stat_cache_engine; |
} stat_cache_engine; |
unsigned short enable_cores; |
unsigned short enable_cores; |
unsigned short reject_expect_100_with_417; |
unsigned short reject_expect_100_with_417; |
|
buffer *xattr_name; |
|
|
|
unsigned short http_header_strict; |
|
unsigned short http_host_strict; |
|
unsigned short http_host_normalize; |
|
unsigned short high_precision_timestamps; |
} server_config; |
} server_config; |
|
|
typedef struct server_socket { |
typedef struct server_socket { |
Line 530 typedef struct server_socket {
|
Line 569 typedef struct server_socket {
|
int fd; |
int fd; |
int fde_ndx; |
int fde_ndx; |
|
|
buffer *ssl_pemfile; |
|
buffer *ssl_ca_file; |
|
buffer *ssl_cipher_list; |
|
buffer *ssl_dh_file; |
|
buffer *ssl_ec_curve; |
|
unsigned short ssl_use_sslv2; |
|
unsigned short ssl_use_sslv3; |
|
unsigned short use_ipv6; |
|
unsigned short is_ssl; |
unsigned short is_ssl; |
|
|
buffer *srv_token; |
buffer *srv_token; |
Line 615 typedef struct server {
|
Line 646 typedef struct server {
|
buffer *ts_date_str; |
buffer *ts_date_str; |
|
|
/* config-file */ |
/* config-file */ |
array *config; |
|
array *config_touched; |
array *config_touched; |
|
|
array *config_context; |
array *config_context; |