blob: c4d15ca87be51c38ef826533997d3fc4e6e7dad7 [file] [log] [blame]
Igor Sysoev4e9393a2003-01-09 05:36:00 +00001#ifndef _NGX_HTTP_CORE_H_INCLUDED_
2#define _NGX_HTTP_CORE_H_INCLUDED_
3
4
5#include <ngx_string.h>
6#include <ngx_array.h>
7#include <ngx_http.h>
8
9
10typedef struct {
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000011 int addr;
12 int port;
13 int family;
14 int flags; /* 'default' */
15 ngx_str_t file_name;
16 int line;
Igor Sysoev4e9393a2003-01-09 05:36:00 +000017} ngx_http_listen_t;
18
19
20typedef struct {
21 ngx_array_t locations; /* array of ngx_http_core_loc_conf_t */
22
23 ngx_array_t listen; /* 'listen', array of ngx_http_listen_t */
24 ngx_array_t server_names; /* 'server_name',
25 array of ngx_http_server_name_t */
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000026 ngx_http_conf_ctx_t *ctx; /* server ctx */
Igor Sysoev4e9393a2003-01-09 05:36:00 +000027} ngx_http_core_srv_conf_t;
28
29
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000030/* list of structures to find core_srv_conf quickly at run time */
Igor Sysoev4e9393a2003-01-09 05:36:00 +000031
32typedef struct {
33 int port;
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000034 ngx_array_t addr; /* array of ngx_http_in_addr_t */
Igor Sysoev4e9393a2003-01-09 05:36:00 +000035} ngx_http_in_port_t;
36
37typedef struct {
38 u_int32_t addr;
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000039 ngx_array_t names; /* array of ngx_http_server_name_t */
40 ngx_http_core_srv_conf_t *core_srv_conf; /* default server conf
41 for this address:port */
42 int flags;
Igor Sysoev4e9393a2003-01-09 05:36:00 +000043} ngx_http_in_addr_t;
44
45#define NGX_HTTP_DEFAULT_SERVER 1
46
Igor Sysoevfe5cb6b2003-01-29 07:25:51 +000047typedef struct {
48 ngx_str_t name;
49 ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */
50} ngx_http_server_name_t;
51
52
Igor Sysoev4e9393a2003-01-09 05:36:00 +000053
54
55typedef struct {
56 ngx_str_t name; /* location name */
Igor Sysoeva19a85e2003-01-28 15:56:37 +000057 void **loc_conf; /* pointer to modules loc_conf,
58 used in translation handler */
Igor Sysoev4e9393a2003-01-09 05:36:00 +000059
60 ngx_str_t doc_root; /* 'root' */
61
62 time_t send_timeout; /* 'send_timeout' */
63 size_t discarded_buffer_size; /* 'discarded_buffer_size */
64 time_t lingering_time; /* 'lingering_time */
65 ngx_msec_t lingering_timeout; /* 'lingering_timeout */
66} ngx_http_core_loc_conf_t;
67
68
69
70
71#if 0
72typedef struct {
73 int dummy;
74} ngx_http_core_conf_t;
75#endif
76
77
78extern ngx_http_module_t ngx_http_core_module_ctx;
79extern ngx_module_t ngx_http_core_module;
80
81extern int (*ngx_http_top_header_filter) (ngx_http_request_t *r);
82extern int ngx_http_max_module;
83
84
85
86int ngx_http_core_translate_handler(ngx_http_request_t *r);
87
Igor Sysoev2a2d2b52003-01-30 18:21:39 +000088int ngx_http_error(ngx_http_request_t *r, int error);
89int ngx_http_close_request(ngx_http_request_t *r);
Igor Sysoev4e9393a2003-01-09 05:36:00 +000090
91
92#endif /* _NGX_HTTP_CORE_H_INCLUDED_ */