146
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
|
4 */
|
|
5
|
|
6
|
|
7 #ifndef _NGX_HTTP_SSI_FILTER_H_INCLUDED_
|
|
8 #define _NGX_HTTP_SSI_FILTER_H_INCLUDED_
|
|
9
|
|
10
|
|
11 #include <ngx_config.h>
|
|
12 #include <ngx_core.h>
|
|
13 #include <ngx_http.h>
|
|
14
|
|
15
|
|
16 #define NGX_HTTP_SSI_MAX_PARAMS 16
|
|
17
|
158
|
18 #define NGX_HTTP_SSI_COMMAND_LEN 32
|
|
19 #define NGX_HTTP_SSI_PARAM_LEN 32
|
146
|
20 #define NGX_HTTP_SSI_PARAMS_N 4
|
|
21
|
|
22
|
|
23 typedef struct {
|
|
24 ngx_hash_t hash;
|
|
25 ngx_hash_keys_arrays_t commands;
|
|
26 } ngx_http_ssi_main_conf_t;
|
|
27
|
|
28
|
|
29 typedef struct {
|
|
30 ngx_buf_t *buf;
|
|
31
|
|
32 u_char *pos;
|
|
33 u_char *copy_start;
|
|
34 u_char *copy_end;
|
|
35
|
|
36 ngx_uint_t key;
|
|
37 ngx_str_t command;
|
|
38 ngx_array_t params;
|
|
39 ngx_table_elt_t *param;
|
|
40 ngx_table_elt_t params_array[NGX_HTTP_SSI_PARAMS_N];
|
|
41
|
|
42 ngx_chain_t *in;
|
|
43 ngx_chain_t *out;
|
|
44 ngx_chain_t **last_out;
|
|
45 ngx_chain_t *busy;
|
|
46 ngx_chain_t *free;
|
|
47
|
|
48 ngx_uint_t state;
|
|
49 ngx_uint_t saved_state;
|
|
50 size_t saved;
|
|
51 size_t looked;
|
|
52
|
|
53 size_t value_len;
|
|
54
|
|
55 ngx_array_t variables;
|
|
56
|
|
57 ngx_uint_t output; /* unsigned output:1; */
|
|
58
|
158
|
59 void *value_buf;
|
146
|
60 ngx_str_t timefmt;
|
|
61 ngx_str_t errmsg;
|
|
62 } ngx_http_ssi_ctx_t;
|
|
63
|
|
64
|
|
65 typedef ngx_int_t (*ngx_http_ssi_command_pt) (ngx_http_request_t *r,
|
|
66 ngx_http_ssi_ctx_t *ctx, ngx_str_t **);
|
|
67
|
|
68
|
|
69 typedef struct {
|
|
70 ngx_str_t name;
|
|
71 ngx_uint_t index;
|
|
72
|
|
73 unsigned mandatory:1;
|
|
74 unsigned multiple:1;
|
|
75 } ngx_http_ssi_param_t;
|
|
76
|
|
77
|
|
78 typedef struct {
|
|
79 ngx_str_t name;
|
|
80 ngx_http_ssi_command_pt handler;
|
|
81 ngx_http_ssi_param_t *params;
|
|
82
|
|
83 unsigned conditional:1;
|
|
84 unsigned flush:1;
|
|
85 } ngx_http_ssi_command_t;
|
|
86
|
|
87
|
|
88 extern ngx_module_t ngx_http_ssi_filter_module;
|
|
89
|
|
90
|
|
91 #endif /* _NGX_HTTP_SSI_FILTER_H_INCLUDED_ */
|