nginx-quic/src/http/ngx_http_core_module.h

143 lines
4.2 KiB
C
Raw Normal View History

2003-01-09 02:36:00 -03:00
#ifndef _NGX_HTTP_CORE_H_INCLUDED_
#define _NGX_HTTP_CORE_H_INCLUDED_
#include <ngx_string.h>
#include <ngx_array.h>
#include <ngx_http.h>
typedef struct {
2003-02-06 14:21:13 -03:00
u_int32_t addr;
2003-01-29 04:25:51 -03:00
int port;
int family;
int flags; /* 'default' */
ngx_str_t file_name;
int line;
2003-01-09 02:36:00 -03:00
} ngx_http_listen_t;
2003-05-16 11:27:48 -04:00
typedef struct {
2003-05-19 12:39:14 -04:00
int post_accept_timeout;
int connection_pool_size;
2003-05-16 11:27:48 -04:00
int request_pool_size;
2003-05-19 12:39:14 -04:00
int client_header_timeout;
2003-05-16 11:27:48 -04:00
int client_header_buffer_size;
2003-05-19 12:39:14 -04:00
int large_client_header;
int url_in_error_log;
ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */
2003-05-16 11:27:48 -04:00
} ngx_http_core_main_conf_t;
2003-01-09 02:36:00 -03:00
typedef struct {
2003-05-19 12:39:14 -04:00
ngx_array_t locations; /* array of ngx_http_core_loc_conf_t,
used in the translation handler
and in the merge phase */
2003-01-09 02:36:00 -03:00
ngx_array_t listen; /* 'listen', array of ngx_http_listen_t */
ngx_array_t server_names; /* 'server_name',
array of ngx_http_server_name_t */
2003-05-19 12:39:14 -04:00
2003-01-29 04:25:51 -03:00
ngx_http_conf_ctx_t *ctx; /* server ctx */
2003-01-09 02:36:00 -03:00
} ngx_http_core_srv_conf_t;
2003-01-29 04:25:51 -03:00
/* list of structures to find core_srv_conf quickly at run time */
2003-01-09 02:36:00 -03:00
typedef struct {
int port;
2003-05-15 11:42:53 -04:00
ngx_array_t addrs; /* array of ngx_http_in_addr_t */
2003-01-09 02:36:00 -03:00
} ngx_http_in_port_t;
2003-05-15 11:42:53 -04:00
2003-01-09 02:36:00 -03:00
typedef struct {
u_int32_t addr;
2003-01-29 04:25:51 -03:00
ngx_array_t names; /* array of ngx_http_server_name_t */
ngx_http_core_srv_conf_t *core_srv_conf; /* default server conf
for this address:port */
int flags;
2003-01-09 02:36:00 -03:00
} ngx_http_in_addr_t;
2003-05-15 11:42:53 -04:00
/* ngx_http_in_addr_t's flags */
2003-01-09 02:36:00 -03:00
#define NGX_HTTP_DEFAULT_SERVER 1
2003-05-15 11:42:53 -04:00
2003-01-29 04:25:51 -03:00
typedef struct {
ngx_str_t name;
ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */
} ngx_http_server_name_t;
2003-05-14 13:13:13 -04:00
#define NGX_HTTP_TYPES_HASH_PRIME 13
#define ngx_http_types_hash_key(key, ext) \
{ \
2003-05-15 11:42:53 -04:00
uint n; \
2003-05-14 13:13:13 -04:00
for (key = 0, n = 0; n < ext.len; n++) { \
key += ext.data[n]; \
} \
key %= NGX_HTTP_TYPES_HASH_PRIME; \
}
typedef struct {
ngx_str_t exten;
ngx_str_t type;
} ngx_http_type_t;
2003-01-09 02:36:00 -03:00
typedef struct {
ngx_str_t name; /* location name */
2003-05-19 12:39:14 -04:00
void **loc_conf ; /* pointer to the modules' loc_conf */
2003-01-09 02:36:00 -03:00
2003-04-08 11:40:10 -04:00
int (*handler) (ngx_http_request_t *r);
2003-03-20 12:09:44 -04:00
ngx_str_t doc_root; /* root */
2003-01-09 02:36:00 -03:00
2003-05-14 13:13:13 -04:00
ngx_array_t *types;
2003-04-08 11:40:10 -04:00
int sendfile; /* sendfile */
2003-05-15 11:42:53 -04:00
ngx_msec_t send_timeout; /* send_timeout */
2003-03-20 12:09:44 -04:00
size_t send_lowat; /* send_lowa */
size_t discarded_buffer_size; /* discarded_buffer_size */
2003-05-15 11:42:53 -04:00
ngx_msec_t lingering_time; /* lingering_time */
2003-03-20 12:09:44 -04:00
ngx_msec_t lingering_timeout; /* lingering_timeout */
2003-04-08 11:40:10 -04:00
2003-01-09 02:36:00 -03:00
} ngx_http_core_loc_conf_t;
#if 0
typedef struct {
int dummy;
} ngx_http_core_conf_t;
#endif
2003-04-08 11:40:10 -04:00
#if 0
#define ngx_http_set_loc_handler(conf_ctx, ngx_http_handler) \
{ \
ngx_http_conf_ctx_t *cx = conf_ctx; \
ngx_http_core_loc_conf_t *lcf; \
lcf = cx->loc_conf[ngx_http_core_module_ctx.index]; \
lcf->handler = ngx_http_handler; \
}
#endif
2003-01-09 02:36:00 -03:00
extern ngx_http_module_t ngx_http_core_module_ctx;
extern ngx_module_t ngx_http_core_module;
extern int ngx_http_max_module;
int ngx_http_core_translate_handler(ngx_http_request_t *r);
2003-02-06 14:21:13 -03:00
int ngx_http_internal_redirect(ngx_http_request_t *r, ngx_str_t uri);
2003-01-30 15:21:39 -03:00
int ngx_http_error(ngx_http_request_t *r, int error);
2003-03-20 12:09:44 -04:00
2003-01-09 02:36:00 -03:00
#endif /* _NGX_HTTP_CORE_H_INCLUDED_ */