comparison src/http/modules/ngx_http_xslt_filter_module.c @ 2148:071bc0fc1459

style fix
author Igor Sysoev <igor@sysoev.ru>
date Mon, 04 Aug 2008 20:25:51 +0000
parents dad4423ef56a
children 50cede290146
comparison
equal deleted inserted replaced
2147:c99db89ebf35 2148:071bc0fc1459
34 34
35 35
36 typedef struct { 36 typedef struct {
37 xmlDtdPtr dtd; 37 xmlDtdPtr dtd;
38 ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ 38 ngx_array_t sheets; /* ngx_http_xslt_sheet_t */
39 ngx_hash_t types_hash; 39 ngx_hash_t types;
40 ngx_array_t *keys; 40 ngx_array_t *types_keys;
41 } ngx_http_xslt_filter_conf_t; 41 } ngx_http_xslt_filter_conf_t;
42 42
43 43
44 typedef struct { 44 typedef struct {
45 xmlDocPtr doc; 45 xmlDocPtr doc;
146 146
147 { ngx_string("xslt_types"), 147 { ngx_string("xslt_types"),
148 NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_1MORE, 148 NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_1MORE,
149 ngx_http_types_slot, 149 ngx_http_types_slot,
150 NGX_HTTP_LOC_CONF_OFFSET, 150 NGX_HTTP_LOC_CONF_OFFSET,
151 offsetof(ngx_http_xslt_filter_conf_t, keys), 151 offsetof(ngx_http_xslt_filter_conf_t, types_keys),
152 &ngx_http_xslt_default_types[0] }, 152 &ngx_http_xslt_default_types[0] },
153 153
154 ngx_null_command 154 ngx_null_command
155 }; 155 };
156 156
204 } 204 }
205 205
206 conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module); 206 conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module);
207 207
208 if (conf->sheets.nelts == 0 208 if (conf->sheets.nelts == 0
209 || ngx_http_test_content_type(r, &conf->types_hash) == NULL) 209 || ngx_http_test_content_type(r, &conf->types) == NULL)
210 { 210 {
211 return ngx_http_next_header_filter(r); 211 return ngx_http_next_header_filter(r);
212 } 212 }
213 213
214 ctx = ngx_http_get_module_ctx(r, ngx_http_xslt_filter_module); 214 ctx = ngx_http_get_module_ctx(r, ngx_http_xslt_filter_module);
1051 } 1051 }
1052 1052
1053 /* 1053 /*
1054 * set by ngx_pcalloc(): 1054 * set by ngx_pcalloc():
1055 * 1055 *
1056 * conf->dtd 1056 * conf->dtd = NULL;
1057 * conf->sheets 1057 * conf->sheets = { NULL };
1058 * conf->types = { NULL };
1059 * conf->types_keys = NULL;
1058 */ 1060 */
1059 1061
1060 return conf; 1062 return conf;
1061 } 1063 }
1062 1064
1073 1075
1074 if (conf->sheets.nelts == 0) { 1076 if (conf->sheets.nelts == 0) {
1075 conf->sheets = prev->sheets; 1077 conf->sheets = prev->sheets;
1076 } 1078 }
1077 1079
1078 if (ngx_http_merge_types(cf, conf->keys, &conf->types_hash, prev->keys, 1080 if (ngx_http_merge_types(cf, conf->types_keys, &conf->types,
1079 &prev->types_hash, ngx_http_xslt_default_types) 1081 prev->types_keys, &prev->types,
1082 ngx_http_xslt_default_types)
1080 != NGX_OK) 1083 != NGX_OK)
1081 { 1084 {
1082 return NGX_CONF_ERROR; 1085 return NGX_CONF_ERROR;
1083 } 1086 }
1084 1087