diff src/http/modules/ngx_http_charset_filter_module.c @ 681:7e24168b0853 release-0.4.0

nginx-0.4.0-RELEASE import *) 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; the bug had appeared in 0.1.29.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 30 Aug 2006 10:39:17 +0000
parents 63a820b0bc6c
children 907361d07f25
line wrap: on
line diff
--- a/src/http/modules/ngx_http_charset_filter_module.c
+++ b/src/http/modules/ngx_http_charset_filter_module.c
@@ -102,8 +102,6 @@ static char *ngx_http_set_charset_slot(n
     void *conf);
 static ngx_int_t ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name);
 
-static ngx_int_t ngx_http_charset_filter_init(ngx_cycle_t *cycle);
-
 static void *ngx_http_charset_create_main_conf(ngx_conf_t *cf);
 static void *ngx_http_charset_create_loc_conf(ngx_conf_t *cf);
 static char *ngx_http_charset_merge_loc_conf(ngx_conf_t *cf,
@@ -169,7 +167,7 @@ ngx_module_t  ngx_http_charset_filter_mo
     ngx_http_charset_filter_commands,      /* module directives */
     NGX_HTTP_MODULE,                       /* module type */
     NULL,                                  /* init master */
-    ngx_http_charset_filter_init,          /* init module */
+    NULL,                                  /* init module */
     NULL,                                  /* init process */
     NULL,                                  /* init thread */
     NULL,                                  /* exit thread */
@@ -1334,19 +1332,6 @@ ngx_http_add_charset(ngx_array_t *charse
 }
 
 
-static ngx_int_t
-ngx_http_charset_filter_init(ngx_cycle_t *cycle)
-{
-    ngx_http_next_header_filter = ngx_http_top_header_filter;
-    ngx_http_top_header_filter = ngx_http_charset_header_filter;
-
-    ngx_http_next_body_filter = ngx_http_top_body_filter;
-    ngx_http_top_body_filter = ngx_http_charset_body_filter;
-
-    return NGX_OK;
-}
-
-
 static void *
 ngx_http_charset_create_main_conf(ngx_conf_t *cf)
 {
@@ -1516,5 +1501,11 @@ ngx_http_charset_postconfiguration(ngx_c
         dst[tables[t].src] = tables[t].dst2src;
     }
 
+    ngx_http_next_header_filter = ngx_http_top_header_filter;
+    ngx_http_top_header_filter = ngx_http_charset_header_filter;
+
+    ngx_http_next_body_filter = ngx_http_top_body_filter;
+    ngx_http_top_body_filter = ngx_http_charset_body_filter;
+
     return NGX_OK;
 }