annotate src/http/modules/ngx_http_ssi_filter_module.h @ 656:9d21dad0b5a1 NGINX_1_1_12

nginx 1.1.12 *) Change: a "proxy_pass" directive without URI part now uses changed URI after redirection with the "error_page" directive; Thanks to Lanshun Zhou. *) Feature: the "proxy/fastcgi/scgi/uwsgi_cache_lock", "proxy/fastcgi/scgi/uwsgi_cache_lock_timeout" directives. *) Feature: the "pcre_jit" directive. *) Feature: the "if" SSI command supports captures in regular expressions. *) Bugfix: the "if" SSI command did not work inside the "block" command. *) Bugfix: the "limit_conn_log_level" and "limit_req_log_level" directives might not work. *) Bugfix: the "limit_rate" directive did not allow to use full throughput, even if limit value was very high. *) Bugfix: the "sendfile_max_chunk" directive did not work, if the "limit_rate" directive was used. *) Bugfix: a "proxy_pass" directive without URI part always used original request URI if variables were used. *) Bugfix: a "proxy_pass" directive without URI part might use original request after redirection with the "try_files" directive; Thanks to Lanshun Zhou. *) Bugfix: in the ngx_http_scgi_module. *) Bugfix: in the ngx_http_mp4_module. *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 1.1.9.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 Dec 2011 00:00:00 +0400
parents 10cc350ed8a1
children d0f7a625f27c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
4 */
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7 #ifndef _NGX_HTTP_SSI_FILTER_H_INCLUDED_
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #define _NGX_HTTP_SSI_FILTER_H_INCLUDED_
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11 #include <ngx_config.h>
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_core.h>
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13 #include <ngx_http.h>
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15
340
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
16 #define NGX_HTTP_SSI_MAX_PARAMS 16
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
17
340
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
18 #define NGX_HTTP_SSI_COMMAND_LEN 32
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
19 #define NGX_HTTP_SSI_PARAM_LEN 32
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
20 #define NGX_HTTP_SSI_PARAMS_N 4
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
21
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
22
340
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
23 #define NGX_HTTP_SSI_COND_IF 1
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
24 #define NGX_HTTP_SSI_COND_ELSE 2
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
25
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
26
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
27 #define NGX_HTTP_SSI_NO_ENCODING 0
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
28 #define NGX_HTTP_SSI_URL_ENCODING 1
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
29 #define NGX_HTTP_SSI_ENTITY_ENCODING 2
178
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
30
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
31
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
32 typedef struct {
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
33 ngx_hash_t hash;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
34 ngx_hash_keys_arrays_t commands;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
35 } ngx_http_ssi_main_conf_t;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
36
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
37
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
38 typedef struct {
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
39 ngx_buf_t *buf;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
40
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
41 u_char *pos;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
42 u_char *copy_start;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
43 u_char *copy_end;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
44
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
45 ngx_uint_t key;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
46 ngx_str_t command;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
47 ngx_array_t params;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
48 ngx_table_elt_t *param;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
49 ngx_table_elt_t params_array[NGX_HTTP_SSI_PARAMS_N];
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
50
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
51 ngx_chain_t *in;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
52 ngx_chain_t *out;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
53 ngx_chain_t **last_out;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
54 ngx_chain_t *busy;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
55 ngx_chain_t *free;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
56
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
57 ngx_uint_t state;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
58 ngx_uint_t saved_state;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
59 size_t saved;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
60 size_t looked;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
61
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
62 size_t value_len;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
63
248
acd2ec3541cb nginx 0.4.9
Igor Sysoev <http://sysoev.ru>
parents: 244
diff changeset
64 ngx_list_t *variables;
216
fa32d59d9a15 nginx 0.3.55
Igor Sysoev <http://sysoev.ru>
parents: 194
diff changeset
65 ngx_array_t *blocks;
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
66
656
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
67 #if (NGX_PCRE)
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
68 ngx_uint_t ncaptures;
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
69 int *captures;
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
70 u_char *captures_data;
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
71 #endif
9d21dad0b5a1 nginx 1.1.12
Igor Sysoev <http://sysoev.ru>
parents: 340
diff changeset
72
178
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
73 unsigned conditional:2;
340
10cc350ed8a1 nginx 0.6.14
Igor Sysoev <http://sysoev.ru>
parents: 248
diff changeset
74 unsigned encoding:2;
216
fa32d59d9a15 nginx 0.3.55
Igor Sysoev <http://sysoev.ru>
parents: 194
diff changeset
75 unsigned block:1;
178
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
76 unsigned output:1;
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
77 unsigned output_chosen:1;
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
78
244
500a3242dff6 nginx 0.4.7
Igor Sysoev <http://sysoev.ru>
parents: 216
diff changeset
79 ngx_http_request_t *wait;
158
2d15b82126ed nginx 0.3.26
Igor Sysoev <http://sysoev.ru>
parents: 146
diff changeset
80 void *value_buf;
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
81 ngx_str_t timefmt;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
82 ngx_str_t errmsg;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
83 } ngx_http_ssi_ctx_t;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
84
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
85
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
86 typedef ngx_int_t (*ngx_http_ssi_command_pt) (ngx_http_request_t *r,
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
87 ngx_http_ssi_ctx_t *ctx, ngx_str_t **);
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
88
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
89
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
90 typedef struct {
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
91 ngx_str_t name;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
92 ngx_uint_t index;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
93
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
94 unsigned mandatory:1;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
95 unsigned multiple:1;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
96 } ngx_http_ssi_param_t;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
97
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
98
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
99 typedef struct {
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
100 ngx_str_t name;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
101 ngx_http_ssi_command_pt handler;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
102 ngx_http_ssi_param_t *params;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
103
178
87699398f955 nginx 0.3.36
Igor Sysoev <http://sysoev.ru>
parents: 158
diff changeset
104 unsigned conditional:2;
216
fa32d59d9a15 nginx 0.3.55
Igor Sysoev <http://sysoev.ru>
parents: 194
diff changeset
105 unsigned block:1;
146
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
106 unsigned flush:1;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
107 } ngx_http_ssi_command_t;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
108
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
109
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
110 extern ngx_module_t ngx_http_ssi_filter_module;
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
111
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
112
36af50a5582d nginx 0.3.20
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
113 #endif /* _NGX_HTTP_SSI_FILTER_H_INCLUDED_ */