0
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
|
4 */
|
|
5
|
|
6
|
|
7 #ifndef _NGX_HTTP_H_INCLUDED_
|
|
8 #define _NGX_HTTP_H_INCLUDED_
|
|
9
|
|
10
|
|
11 #include <ngx_config.h>
|
|
12 #include <ngx_core.h>
|
|
13 #include <ngx_garbage_collector.h>
|
|
14
|
|
15 typedef struct ngx_http_request_s ngx_http_request_t;
|
|
16 typedef struct ngx_http_cleanup_s ngx_http_cleanup_t;
|
26
|
17 typedef struct ngx_http_in_addr_s ngx_http_in_addr_t;
|
0
|
18
|
|
19 #if (NGX_HTTP_CACHE)
|
|
20 #include <ngx_http_cache.h>
|
|
21 #endif
|
|
22 /* STUB */
|
|
23 #include <ngx_http_cache.h>
|
|
24
|
|
25 #include <ngx_http_request.h>
|
|
26 #include <ngx_http_config.h>
|
|
27 #include <ngx_http_busy_lock.h>
|
|
28 #include <ngx_http_log_handler.h>
|
|
29 #include <ngx_http_core_module.h>
|
|
30
|
|
31 #if (NGX_HTTP_SSL)
|
|
32 #include <ngx_http_ssl_module.h>
|
|
33 #endif
|
|
34
|
|
35
|
|
36 typedef struct {
|
10
|
37 u_int connection;
|
0
|
38
|
|
39 /*
|
|
40 * we declare "action" as "char *" because the actions are usually
|
|
41 * the static strings and in the "u_char *" case we have to override
|
|
42 * all the time their types
|
|
43 */
|
|
44
|
10
|
45 char *action;
|
|
46 ngx_str_t *client;
|
|
47 ngx_http_request_t *request;
|
0
|
48 } ngx_http_log_ctx_t;
|
|
49
|
|
50
|
|
51 #define ngx_http_get_module_ctx(r, module) r->ctx[module.ctx_index]
|
|
52 #define ngx_http_get_module_err_ctx(r, module) \
|
|
53 (r->err_ctx ? r->err_ctx[module.ctx_index] : r->ctx[module.ctx_index])
|
|
54
|
|
55 #define ngx_http_create_ctx(r, cx, module, size, error) \
|
|
56 do { \
|
|
57 ngx_test_null(cx, ngx_pcalloc(r->pool, size), error); \
|
|
58 r->ctx[module.ctx_index] = cx; \
|
|
59 } while (0)
|
|
60
|
|
61 #define ngx_http_delete_ctx(r, module) \
|
|
62 r->ctx[module.ctx_index] = NULL;
|
|
63
|
|
64
|
|
65 void ngx_http_init_connection(ngx_connection_t *c);
|
|
66
|
|
67 ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
|
|
68 ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r);
|
|
69 ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b);
|
|
70
|
|
71 ngx_int_t ngx_http_find_server_conf(ngx_http_request_t *r);
|
|
72 void ngx_http_handler(ngx_http_request_t *r);
|
|
73 void ngx_http_finalize_request(ngx_http_request_t *r, int error);
|
|
74 void ngx_http_writer(ngx_event_t *wev);
|
|
75
|
|
76 void ngx_http_empty_handler(ngx_event_t *wev);
|
|
77
|
|
78 ngx_int_t ngx_http_send_last(ngx_http_request_t *r);
|
|
79 void ngx_http_close_request(ngx_http_request_t *r, int error);
|
|
80 void ngx_http_close_connection(ngx_connection_t *c);
|
|
81
|
|
82
|
|
83 ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r);
|
|
84
|
|
85 ngx_int_t ngx_http_send_header(ngx_http_request_t *r);
|
|
86 ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r, int error);
|
|
87
|
|
88
|
|
89 time_t ngx_http_parse_time(u_char *value, size_t len);
|
|
90 size_t ngx_http_get_time(char *buf, time_t t);
|
|
91
|
|
92
|
|
93
|
|
94 ngx_int_t ngx_http_discard_body(ngx_http_request_t *r);
|
|
95
|
|
96
|
|
97 extern ngx_module_t ngx_http_module;
|
|
98
|
|
99
|
|
100 extern ngx_uint_t ngx_http_total_requests;
|
|
101 extern uint64_t ngx_http_total_sent;
|
|
102
|
|
103
|
|
104 extern ngx_http_output_header_filter_pt ngx_http_top_header_filter;
|
|
105 extern ngx_http_output_body_filter_pt ngx_http_top_body_filter;
|
|
106
|
|
107
|
|
108 /* STUB */
|
|
109 ngx_int_t ngx_http_log_handler(ngx_http_request_t *r);
|
|
110 /**/
|
|
111
|
|
112
|
|
113 #endif /* _NGX_HTTP_H_INCLUDED_ */
|