comparison src/http/modules/ngx_http_charset_filter_module.c @ 230:38e7b94d63ac NGINX_0_4_0

nginx 0.4.0 *) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; bug appeared in 0.1.29.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Aug 2006 00:00:00 +0400
parents fa32d59d9a15
children 500a3242dff6
comparison
equal deleted inserted replaced
229:1965c8e23be7 230:38e7b94d63ac
100 100
101 static char *ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd, 101 static char *ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd,
102 void *conf); 102 void *conf);
103 static ngx_int_t ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name); 103 static ngx_int_t ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name);
104 104
105 static ngx_int_t ngx_http_charset_filter_init(ngx_cycle_t *cycle);
106
107 static void *ngx_http_charset_create_main_conf(ngx_conf_t *cf); 105 static void *ngx_http_charset_create_main_conf(ngx_conf_t *cf);
108 static void *ngx_http_charset_create_loc_conf(ngx_conf_t *cf); 106 static void *ngx_http_charset_create_loc_conf(ngx_conf_t *cf);
109 static char *ngx_http_charset_merge_loc_conf(ngx_conf_t *cf, 107 static char *ngx_http_charset_merge_loc_conf(ngx_conf_t *cf,
110 void *parent, void *child); 108 void *parent, void *child);
111 static ngx_int_t ngx_http_charset_postconfiguration(ngx_conf_t *cf); 109 static ngx_int_t ngx_http_charset_postconfiguration(ngx_conf_t *cf);
167 NGX_MODULE_V1, 165 NGX_MODULE_V1,
168 &ngx_http_charset_filter_module_ctx, /* module context */ 166 &ngx_http_charset_filter_module_ctx, /* module context */
169 ngx_http_charset_filter_commands, /* module directives */ 167 ngx_http_charset_filter_commands, /* module directives */
170 NGX_HTTP_MODULE, /* module type */ 168 NGX_HTTP_MODULE, /* module type */
171 NULL, /* init master */ 169 NULL, /* init master */
172 ngx_http_charset_filter_init, /* init module */ 170 NULL, /* init module */
173 NULL, /* init process */ 171 NULL, /* init process */
174 NULL, /* init thread */ 172 NULL, /* init thread */
175 NULL, /* exit thread */ 173 NULL, /* exit thread */
176 NULL, /* exit process */ 174 NULL, /* exit process */
177 NULL, /* exit master */ 175 NULL, /* exit master */
1332 1330
1333 return i; 1331 return i;
1334 } 1332 }
1335 1333
1336 1334
1337 static ngx_int_t
1338 ngx_http_charset_filter_init(ngx_cycle_t *cycle)
1339 {
1340 ngx_http_next_header_filter = ngx_http_top_header_filter;
1341 ngx_http_top_header_filter = ngx_http_charset_header_filter;
1342
1343 ngx_http_next_body_filter = ngx_http_top_body_filter;
1344 ngx_http_top_body_filter = ngx_http_charset_body_filter;
1345
1346 return NGX_OK;
1347 }
1348
1349
1350 static void * 1335 static void *
1351 ngx_http_charset_create_main_conf(ngx_conf_t *cf) 1336 ngx_http_charset_create_main_conf(ngx_conf_t *cf)
1352 { 1337 {
1353 ngx_http_charset_main_conf_t *mcf; 1338 ngx_http_charset_main_conf_t *mcf;
1354 1339
1514 1499
1515 src[tables[t].dst] = tables[t].src2dst; 1500 src[tables[t].dst] = tables[t].src2dst;
1516 dst[tables[t].src] = tables[t].dst2src; 1501 dst[tables[t].src] = tables[t].dst2src;
1517 } 1502 }
1518 1503
1504 ngx_http_next_header_filter = ngx_http_top_header_filter;
1505 ngx_http_top_header_filter = ngx_http_charset_header_filter;
1506
1507 ngx_http_next_body_filter = ngx_http_top_body_filter;
1508 ngx_http_top_body_filter = ngx_http_charset_body_filter;
1509
1519 return NGX_OK; 1510 return NGX_OK;
1520 } 1511 }