Mercurial > hg > nginx-vendor-0-5
comparison src/http/modules/ngx_http_charset_filter.c @ 26:45fe5b98a9de NGINX_0_1_13
nginx 0.1.13
*) Feature: the server_names_hash and server_names_hash_threshold
directives.
*) Bugfix: the *.domain.tld names in the "server_name" directive did
not work.
*) Bugfix: the %request_length log parameter logged the incorrect
length.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 21 Dec 2004 00:00:00 +0300 |
parents | 46833bd150cb |
children | 6cfc63e68377 |
comparison
equal
deleted
inserted
replaced
25:21488c53e135 | 26:45fe5b98a9de |
---|---|
144 lcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module); | 144 lcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module); |
145 | 145 |
146 if (lcf->enable == 0) { | 146 if (lcf->enable == 0) { |
147 return ngx_http_next_header_filter(r); | 147 return ngx_http_next_header_filter(r); |
148 } | 148 } |
149 | |
150 #if 0 | |
151 if (lcf->default_charset.len == 0) { | |
152 return ngx_http_next_header_filter(r); | |
153 } | |
154 #endif | |
155 | 149 |
156 if (r->headers_out.content_type == NULL) { | 150 if (r->headers_out.content_type == NULL) { |
157 return ngx_http_next_header_filter(r); | 151 return ngx_http_next_header_filter(r); |
158 } | 152 } |
159 | 153 |
557 ngx_http_charset_loc_conf_t *conf = child; | 551 ngx_http_charset_loc_conf_t *conf = child; |
558 | 552 |
559 ngx_conf_merge_value(conf->enable, prev->enable, 0); | 553 ngx_conf_merge_value(conf->enable, prev->enable, 0); |
560 ngx_conf_merge_value(conf->autodetect, prev->autodetect, 0); | 554 ngx_conf_merge_value(conf->autodetect, prev->autodetect, 0); |
561 | 555 |
556 | |
557 if (conf->default_charset == NGX_CONF_UNSET) { | |
558 conf->default_charset = prev->default_charset; | |
559 } | |
560 | |
562 if (conf->source_charset == NGX_CONF_UNSET) { | 561 if (conf->source_charset == NGX_CONF_UNSET) { |
563 conf->source_charset = prev->source_charset; | 562 conf->source_charset = prev->source_charset; |
564 } | 563 } |
565 | 564 |
566 ngx_conf_merge_value(conf->default_charset, prev->default_charset, | 565 if (conf->default_charset == NGX_CONF_UNSET |
567 conf->source_charset); | 566 && conf->source_charset != NGX_CONF_UNSET) |
567 { | |
568 conf->default_charset = conf->source_charset; | |
569 } | |
570 | |
571 if (conf->source_charset == NGX_CONF_UNSET | |
572 && conf->default_charset != NGX_CONF_UNSET) | |
573 { | |
574 conf->source_charset = conf->default_charset; | |
575 } | |
576 | |
577 if (conf->enable | |
578 && (conf->default_charset == NGX_CONF_UNSET | |
579 || conf->source_charset == NGX_CONF_UNSET)) | |
580 { | |
581 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
582 "the \"source_charset\" or \"default_charset\" " | |
583 "must be specified when \"charset\" is on"); | |
584 return NGX_CONF_ERROR; | |
585 } | |
568 | 586 |
569 return NGX_CONF_OK; | 587 return NGX_CONF_OK; |
570 } | 588 } |