Mercurial > hg > nginx
annotate src/stream/ngx_stream.h @ 6680:7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 06 Sep 2016 21:28:16 +0300 |
parents | 40e8ce405859 |
children | 9cac11efb205 |
rev | line source |
---|---|
6115 | 1 |
2 /* | |
3 * Copyright (C) Roman Arutyunyan | |
4 * Copyright (C) Nginx, Inc. | |
5 */ | |
6 | |
7 | |
8 #ifndef _NGX_STREAM_H_INCLUDED_ | |
9 #define _NGX_STREAM_H_INCLUDED_ | |
10 | |
11 | |
12 #include <ngx_config.h> | |
13 #include <ngx_core.h> | |
14 | |
15 #if (NGX_STREAM_SSL) | |
16 #include <ngx_stream_ssl_module.h> | |
17 #endif | |
18 | |
19 | |
20 typedef struct ngx_stream_session_s ngx_stream_session_t; | |
21 | |
22 | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
23 #include <ngx_stream_variables.h> |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
24 #include <ngx_stream_script.h> |
6115 | 25 #include <ngx_stream_upstream.h> |
26 #include <ngx_stream_upstream_round_robin.h> | |
27 | |
28 | |
6674
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
29 #define NGX_STREAM_OK 200 |
6680
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
30 #define NGX_STREAM_BAD_REQUEST 400 |
6674
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
31 #define NGX_STREAM_FORBIDDEN 403 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
32 #define NGX_STREAM_INTERNAL_SERVER_ERROR 500 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
33 #define NGX_STREAM_BAD_GATEWAY 502 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
34 #define NGX_STREAM_SERVICE_UNAVAILABLE 503 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
35 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
36 |
6115 | 37 typedef struct { |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
38 void **main_conf; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
39 void **srv_conf; |
6115 | 40 } ngx_stream_conf_ctx_t; |
41 | |
42 | |
43 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
44 ngx_sockaddr_t sockaddr; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
45 socklen_t socklen; |
6115 | 46 |
47 /* server ctx */ | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
48 ngx_stream_conf_ctx_t *ctx; |
6115 | 49 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
50 unsigned bind:1; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
51 unsigned wildcard:1; |
6115 | 52 #if (NGX_STREAM_SSL) |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
53 unsigned ssl:1; |
6115 | 54 #endif |
55 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
56 unsigned ipv6only:1; |
6115 | 57 #endif |
6153
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
58 #if (NGX_HAVE_REUSEPORT) |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
59 unsigned reuseport:1; |
6153
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
60 #endif |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
61 unsigned so_keepalive:2; |
6680
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
62 unsigned proxy_protocol:1; |
6115 | 63 #if (NGX_HAVE_KEEPALIVE_TUNABLE) |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
64 int tcp_keepidle; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
65 int tcp_keepintvl; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
66 int tcp_keepcnt; |
6115 | 67 #endif |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
68 int backlog; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
69 int type; |
6115 | 70 } ngx_stream_listen_t; |
71 | |
72 | |
73 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
74 ngx_stream_conf_ctx_t *ctx; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
75 ngx_str_t addr_text; |
6115 | 76 #if (NGX_STREAM_SSL) |
6680
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
77 unsigned ssl:1; |
6115 | 78 #endif |
6680
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
79 unsigned proxy_protocol:1; |
6115 | 80 } ngx_stream_addr_conf_t; |
81 | |
82 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
83 in_addr_t addr; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
84 ngx_stream_addr_conf_t conf; |
6115 | 85 } ngx_stream_in_addr_t; |
86 | |
87 | |
88 #if (NGX_HAVE_INET6) | |
89 | |
90 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
91 struct in6_addr addr6; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
92 ngx_stream_addr_conf_t conf; |
6115 | 93 } ngx_stream_in6_addr_t; |
94 | |
95 #endif | |
96 | |
97 | |
98 typedef struct { | |
99 /* ngx_stream_in_addr_t or ngx_stream_in6_addr_t */ | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
100 void *addrs; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
101 ngx_uint_t naddrs; |
6115 | 102 } ngx_stream_port_t; |
103 | |
104 | |
105 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
106 int family; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
107 int type; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
108 in_port_t port; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
109 ngx_array_t addrs; /* array of ngx_stream_conf_addr_t */ |
6115 | 110 } ngx_stream_conf_port_t; |
111 | |
112 | |
113 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
114 ngx_stream_listen_t opt; |
6115 | 115 } ngx_stream_conf_addr_t; |
116 | |
117 | |
6175 | 118 typedef ngx_int_t (*ngx_stream_access_pt)(ngx_stream_session_t *s); |
119 | |
120 | |
6115 | 121 typedef struct { |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
122 ngx_array_t servers; /* ngx_stream_core_srv_conf_t */ |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
123 ngx_array_t listen; /* ngx_stream_listen_t */ |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
124 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
125 ngx_stream_access_pt limit_conn_handler; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
126 ngx_stream_access_pt access_handler; |
6678 | 127 ngx_stream_access_pt access_log_handler; |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
128 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
129 ngx_hash_t variables_hash; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
130 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
131 ngx_array_t variables; /* ngx_stream_variable_t */ |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
132 ngx_uint_t ncaptures; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
133 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
134 ngx_uint_t variables_hash_max_size; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
135 ngx_uint_t variables_hash_bucket_size; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
136 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
137 ngx_hash_keys_arrays_t *variables_keys; |
6115 | 138 } ngx_stream_core_main_conf_t; |
139 | |
140 | |
141 typedef void (*ngx_stream_handler_pt)(ngx_stream_session_t *s); | |
142 | |
143 | |
144 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
145 ngx_stream_handler_pt handler; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
146 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
147 ngx_stream_conf_ctx_t *ctx; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
148 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
149 u_char *file_name; |
6656
a2f57dfa65a9
Fixed wrong type of the "line" field.
Roman Arutyunyan <arut@nginx.com>
parents:
6618
diff
changeset
|
150 ngx_uint_t line; |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
151 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
152 ngx_flag_t tcp_nodelay; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
153 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
154 ngx_log_t *error_log; |
6618 | 155 |
156 ngx_msec_t resolver_timeout; | |
157 ngx_resolver_t *resolver; | |
6657
3d5202c71f94
Ensure "listen" exists in a mail or stream server (ticket #1049).
Roman Arutyunyan <arut@nginx.com>
parents:
6656
diff
changeset
|
158 |
6680
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
159 ngx_msec_t proxy_protocol_timeout; |
7357abd1fa8c
Stream: the "proxy_protocol" parameter of the "listen" directive.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6679
diff
changeset
|
160 |
6657
3d5202c71f94
Ensure "listen" exists in a mail or stream server (ticket #1049).
Roman Arutyunyan <arut@nginx.com>
parents:
6656
diff
changeset
|
161 ngx_uint_t listen; /* unsigned listen:1; */ |
6115 | 162 } ngx_stream_core_srv_conf_t; |
163 | |
164 | |
165 struct ngx_stream_session_s { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
166 uint32_t signature; /* "STRM" */ |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
167 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
168 ngx_connection_t *connection; |
6115 | 169 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
170 off_t received; |
6669
164a0824ce20
Stream: the $session_time variable.
Vladimir Homutov <vl@nginx.com>
parents:
6657
diff
changeset
|
171 time_t start_sec; |
164a0824ce20
Stream: the $session_time variable.
Vladimir Homutov <vl@nginx.com>
parents:
6657
diff
changeset
|
172 ngx_msec_t start_msec; |
6115 | 173 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
174 ngx_log_handler_pt log_handler; |
6115 | 175 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
176 void **ctx; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
177 void **main_conf; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
178 void **srv_conf; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
179 |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
180 ngx_stream_upstream_t *upstream; |
6675
ab9b4fd8c5b7
Stream: the $upstream_addr variable.
Vladimir Homutov <vl@nginx.com>
parents:
6674
diff
changeset
|
181 ngx_array_t *upstream_states; |
ab9b4fd8c5b7
Stream: the $upstream_addr variable.
Vladimir Homutov <vl@nginx.com>
parents:
6674
diff
changeset
|
182 /* of ngx_stream_upstream_state_t */ |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
183 ngx_stream_variable_value_t *variables; |
6115 | 184 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
185 #if (NGX_PCRE) |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
186 ngx_uint_t ncaptures; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
187 int *captures; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
188 u_char *captures_data; |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
189 #endif |
6674
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
190 |
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
191 ngx_uint_t status; |
6679
40e8ce405859
Stream: postpone session initialization under accept mutex.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6678
diff
changeset
|
192 |
40e8ce405859
Stream: postpone session initialization under accept mutex.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6678
diff
changeset
|
193 #if (NGX_STREAM_SSL) |
40e8ce405859
Stream: postpone session initialization under accept mutex.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6678
diff
changeset
|
194 ngx_uint_t ssl; /* unsigned ssl:1; */ |
40e8ce405859
Stream: postpone session initialization under accept mutex.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6678
diff
changeset
|
195 #endif |
6115 | 196 }; |
197 | |
198 | |
199 typedef struct { | |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
200 ngx_int_t (*preconfiguration)(ngx_conf_t *cf); |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
201 ngx_int_t (*postconfiguration)(ngx_conf_t *cf); |
6174
68c106e6fa0a
Stream: added postconfiguration method to stream modules.
Vladimir Homutov <vl@nginx.com>
parents:
6172
diff
changeset
|
202 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
203 void *(*create_main_conf)(ngx_conf_t *cf); |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
204 char *(*init_main_conf)(ngx_conf_t *cf, void *conf); |
6115 | 205 |
6607
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
206 void *(*create_srv_conf)(ngx_conf_t *cf); |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
207 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, |
c70b7f4537e1
Stream: variables and script.
Vladimir Homutov <vl@nginx.com>
parents:
6606
diff
changeset
|
208 void *conf); |
6115 | 209 } ngx_stream_module_t; |
210 | |
211 | |
212 #define NGX_STREAM_MODULE 0x4d525453 /* "STRM" */ | |
213 | |
214 #define NGX_STREAM_MAIN_CONF 0x02000000 | |
215 #define NGX_STREAM_SRV_CONF 0x04000000 | |
216 #define NGX_STREAM_UPS_CONF 0x08000000 | |
217 | |
218 | |
219 #define NGX_STREAM_MAIN_CONF_OFFSET offsetof(ngx_stream_conf_ctx_t, main_conf) | |
220 #define NGX_STREAM_SRV_CONF_OFFSET offsetof(ngx_stream_conf_ctx_t, srv_conf) | |
221 | |
222 | |
223 #define ngx_stream_get_module_ctx(s, module) (s)->ctx[module.ctx_index] | |
224 #define ngx_stream_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; | |
225 #define ngx_stream_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; | |
226 | |
227 | |
228 #define ngx_stream_get_module_main_conf(s, module) \ | |
229 (s)->main_conf[module.ctx_index] | |
230 #define ngx_stream_get_module_srv_conf(s, module) \ | |
231 (s)->srv_conf[module.ctx_index] | |
232 | |
233 #define ngx_stream_conf_get_module_main_conf(cf, module) \ | |
234 ((ngx_stream_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] | |
235 #define ngx_stream_conf_get_module_srv_conf(cf, module) \ | |
236 ((ngx_stream_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] | |
237 | |
238 #define ngx_stream_cycle_get_module_main_conf(cycle, module) \ | |
239 (cycle->conf_ctx[ngx_stream_module.index] ? \ | |
240 ((ngx_stream_conf_ctx_t *) cycle->conf_ctx[ngx_stream_module.index]) \ | |
241 ->main_conf[module.ctx_index]: \ | |
242 NULL) | |
243 | |
244 | |
245 void ngx_stream_init_connection(ngx_connection_t *c); | |
6674
38143d1abdec
Stream: the $status variable.
Roman Arutyunyan <arut@nginx.com>
parents:
6669
diff
changeset
|
246 void ngx_stream_finalize_session(ngx_stream_session_t *s, ngx_uint_t rc); |
6115 | 247 |
248 | |
249 extern ngx_module_t ngx_stream_module; | |
250 extern ngx_uint_t ngx_stream_max_module; | |
251 extern ngx_module_t ngx_stream_core_module; | |
252 | |
253 | |
254 #endif /* _NGX_STREAM_H_INCLUDED_ */ |