aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-01-27 12:51:59 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-01-27 12:51:59 +0000
commiteb1a344dd309446b3f7bbcbf779c1524499e83fc (patch)
tree789735826c58735fc72924b19bd26cc2c2ff6ca4 /src
parentab54e21633e81094f2e3a43043e82b3eb5fb3934 (diff)
downloadnginx-eb1a344dd309446b3f7bbcbf779c1524499e83fc.tar.gz
nginx-eb1a344dd309446b3f7bbcbf779c1524499e83fc.zip
utf8 parameter of geoip_country and geoip_city
patch by Denis F. Latypoff
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_geoip_module.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_geoip_module.c b/src/http/modules/ngx_http_geoip_module.c
index 592314c84..34140a198 100644
--- a/src/http/modules/ngx_http_geoip_module.c
+++ b/src/http/modules/ngx_http_geoip_module.c
@@ -50,14 +50,14 @@ static void ngx_http_geoip_cleanup(void *data);
static ngx_command_t ngx_http_geoip_commands[] = {
{ ngx_string("geoip_country"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
+ NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12,
ngx_http_geoip_country,
NGX_HTTP_MAIN_CONF_OFFSET,
0,
NULL },
{ ngx_string("geoip_city"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
+ NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12,
ngx_http_geoip_city,
NGX_HTTP_MAIN_CONF_OFFSET,
0,
@@ -446,6 +446,17 @@ ngx_http_geoip_country(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
+ if (cf->args->nelts == 3) {
+ if (ngx_strcmp(value[2].data, "utf8") == 0) {
+ GeoIP_set_charset (gcf->country, GEOIP_CHARSET_UTF8);
+
+ } else {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid parameter \"%V\"", &value[2]);
+ return NGX_CONF_ERROR;
+ }
+ }
+
switch (gcf->country->databaseType) {
case GEOIP_COUNTRY_EDITION:
@@ -485,6 +496,17 @@ ngx_http_geoip_city(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
+ if (cf->args->nelts == 3) {
+ if (ngx_strcmp(value[2].data, "utf8") == 0) {
+ GeoIP_set_charset (gcf->city, GEOIP_CHARSET_UTF8);
+
+ } else {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid parameter \"%V\"", &value[2]);
+ return NGX_CONF_ERROR;
+ }
+ }
+
switch (gcf->city->databaseType) {
case GEOIP_CITY_EDITION_REV0: