11
12
#include <ngx_config.h>
12
13
#include <ngx_core.h>
13
#include <ngx_garbage_collector.h>
16
typedef struct ngx_http_request_s ngx_http_request_t;
17
typedef struct ngx_http_upstream_s ngx_http_upstream_t;
18
typedef struct ngx_http_log_ctx_s ngx_http_log_ctx_t;
16
typedef struct ngx_http_request_s ngx_http_request_t;
17
typedef struct ngx_http_upstream_s ngx_http_upstream_t;
18
typedef struct ngx_http_cache_s ngx_http_cache_t;
19
typedef struct ngx_http_file_cache_s ngx_http_file_cache_t;
20
typedef struct ngx_http_log_ctx_s ngx_http_log_ctx_t;
21
typedef struct ngx_http_chunked_s ngx_http_chunked_t;
24
typedef struct ngx_http_spdy_stream_s ngx_http_spdy_stream_t;
20
27
typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
21
28
ngx_table_elt_t *h, ngx_uint_t offset);
23
30
ngx_http_request_t *sr, u_char *buf, size_t len);
27
#include <ngx_http_cache.h>
30
#include <ngx_http_cache.h>
32
33
#include <ngx_http_variables.h>
34
#include <ngx_http_config.h>
33
35
#include <ngx_http_request.h>
36
#include <ngx_http_script.h>
34
37
#include <ngx_http_upstream.h>
35
38
#include <ngx_http_upstream_round_robin.h>
36
#include <ngx_http_config.h>
37
39
#include <ngx_http_busy_lock.h>
38
40
#include <ngx_http_core_module.h>
39
#include <ngx_http_script.h>
43
#include <ngx_http_spdy.h>
46
#include <ngx_http_cache.h>
42
49
#include <ngx_http_ssi_filter_module.h>
63
struct ngx_http_chunked_s {
71
ngx_uint_t http_version;
56
79
#define ngx_http_get_module_ctx(r, module) (r)->ctx[module.ctx_index]
57
80
#define ngx_http_set_ctx(r, c, module) r->ctx[module.ctx_index] = c;
83
ngx_int_t ngx_http_add_location(ngx_conf_t *cf, ngx_queue_t **locations,
84
ngx_http_core_loc_conf_t *clcf);
85
ngx_int_t ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
86
ngx_http_listen_opt_t *lsopt);
60
89
void ngx_http_init_connection(ngx_connection_t *c);
90
void ngx_http_close_connection(ngx_connection_t *c);
62
92
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
63
93
int ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
66
96
ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
97
ngx_int_t ngx_http_parse_uri(ngx_http_request_t *r);
67
98
ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
68
99
ngx_uint_t merge_slashes);
100
ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
101
ngx_http_status_t *status);
69
102
ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
70
103
ngx_str_t *args, ngx_uint_t *flags);
71
ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b);
104
ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
105
ngx_uint_t allow_underscores);
72
106
ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
73
107
ngx_str_t *name, ngx_str_t *value);
75
ngx_int_t ngx_http_find_server_conf(ngx_http_request_t *r);
108
ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
110
void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
112
ngx_int_t ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
113
ngx_http_chunked_t *ctx);
116
ngx_http_request_t *ngx_http_create_request(ngx_connection_t *c);
117
ngx_int_t ngx_http_process_request_uri(ngx_http_request_t *r);
118
ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
119
void ngx_http_process_request(ngx_http_request_t *r);
76
120
void ngx_http_update_location_config(ngx_http_request_t *r);
77
121
void ngx_http_handler(ngx_http_request_t *r);
122
void ngx_http_run_posted_requests(ngx_connection_t *c);
123
ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
124
ngx_http_posted_request_t *pr);
78
125
void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
126
void ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc);
80
128
void ngx_http_empty_handler(ngx_event_t *wev);
81
129
void ngx_http_request_empty_handler(ngx_http_request_t *r);
132
#define ngx_http_ephemeral(r) (void *) (&r->uri_start)
83
135
#define NGX_HTTP_LAST 1
84
136
#define NGX_HTTP_FLUSH 2
102
157
ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r);
158
void ngx_http_discarded_request_body_handler(ngx_http_request_t *r);
103
159
void ngx_http_block_reading(ngx_http_request_t *r);
160
void ngx_http_test_reading(ngx_http_request_t *r);
163
char *ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
164
char *ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys,
165
ngx_hash_t *types_hash, ngx_array_t **prev_keys,
166
ngx_hash_t *prev_types_hash, ngx_str_t *default_types);
167
ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
168
ngx_str_t *default_type);
170
#if (NGX_HTTP_DEGRADATION)
171
ngx_uint_t ngx_http_degraded(ngx_http_request_t *);
106
175
extern ngx_module_t ngx_http_module;
109
extern ngx_uint_t ngx_http_total_requests;
110
extern uint64_t ngx_http_total_sent;
177
extern ngx_str_t ngx_http_html_default_types[];
113
180
extern ngx_http_output_header_filter_pt ngx_http_top_header_filter;