Mercurial > hg > nginx-vendor-current
comparison src/http/modules/ngx_http_geoip_module.c @ 614:bb20316269e4 NGINX_0_9_5
nginx 0.9.5
*) Change: now nginx uses a default listen backlog value -1 on
Linux.
Thanks to Andrei Nigmatulin.
*) Feature: the "utf8" parameter of "geoip_country" and "geoip_city"
directives.
Thanks to Denis F. Latypoff.
*) Bugfix: in a default "proxy_redirect" directive if "proxy_pass"
directive has no URI part.
Thanks to Maxim Dounin.
*) Bugfix: an "error_page" directive did not work with nonstandard
error codes; the bug had appeared in 0.8.53.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 21 Feb 2011 00:00:00 +0300 |
parents | 3436cf38d59e |
children | a7a5fa2e395b |
comparison
equal
deleted
inserted
replaced
613:eaf85af608b8 | 614:bb20316269e4 |
---|---|
48 | 48 |
49 | 49 |
50 static ngx_command_t ngx_http_geoip_commands[] = { | 50 static ngx_command_t ngx_http_geoip_commands[] = { |
51 | 51 |
52 { ngx_string("geoip_country"), | 52 { ngx_string("geoip_country"), |
53 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | 53 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12, |
54 ngx_http_geoip_country, | 54 ngx_http_geoip_country, |
55 NGX_HTTP_MAIN_CONF_OFFSET, | 55 NGX_HTTP_MAIN_CONF_OFFSET, |
56 0, | 56 0, |
57 NULL }, | 57 NULL }, |
58 | 58 |
59 { ngx_string("geoip_city"), | 59 { ngx_string("geoip_city"), |
60 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | 60 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12, |
61 ngx_http_geoip_city, | 61 ngx_http_geoip_city, |
62 NGX_HTTP_MAIN_CONF_OFFSET, | 62 NGX_HTTP_MAIN_CONF_OFFSET, |
63 0, | 63 0, |
64 NULL }, | 64 NULL }, |
65 | 65 |
444 "GeoIO_open(\"%V\") failed", &value[1]); | 444 "GeoIO_open(\"%V\") failed", &value[1]); |
445 | 445 |
446 return NGX_CONF_ERROR; | 446 return NGX_CONF_ERROR; |
447 } | 447 } |
448 | 448 |
449 if (cf->args->nelts == 3) { | |
450 if (ngx_strcmp(value[2].data, "utf8") == 0) { | |
451 GeoIP_set_charset (gcf->country, GEOIP_CHARSET_UTF8); | |
452 | |
453 } else { | |
454 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
455 "invalid parameter \"%V\"", &value[2]); | |
456 return NGX_CONF_ERROR; | |
457 } | |
458 } | |
459 | |
449 switch (gcf->country->databaseType) { | 460 switch (gcf->country->databaseType) { |
450 | 461 |
451 case GEOIP_COUNTRY_EDITION: | 462 case GEOIP_COUNTRY_EDITION: |
452 case GEOIP_PROXY_EDITION: | 463 case GEOIP_PROXY_EDITION: |
453 case GEOIP_NETSPEED_EDITION: | 464 case GEOIP_NETSPEED_EDITION: |
483 "GeoIO_open(\"%V\") failed", &value[1]); | 494 "GeoIO_open(\"%V\") failed", &value[1]); |
484 | 495 |
485 return NGX_CONF_ERROR; | 496 return NGX_CONF_ERROR; |
486 } | 497 } |
487 | 498 |
499 if (cf->args->nelts == 3) { | |
500 if (ngx_strcmp(value[2].data, "utf8") == 0) { | |
501 GeoIP_set_charset (gcf->city, GEOIP_CHARSET_UTF8); | |
502 | |
503 } else { | |
504 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
505 "invalid parameter \"%V\"", &value[2]); | |
506 return NGX_CONF_ERROR; | |
507 } | |
508 } | |
509 | |
488 switch (gcf->city->databaseType) { | 510 switch (gcf->city->databaseType) { |
489 | 511 |
490 case GEOIP_CITY_EDITION_REV0: | 512 case GEOIP_CITY_EDITION_REV0: |
491 case GEOIP_CITY_EDITION_REV1: | 513 case GEOIP_CITY_EDITION_REV1: |
492 | 514 |