Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4713 - trunk/src/http/modules

Anonymous User
June 29, 2012 04:34PM
Author: ru
Date: 2012-06-29 20:33:26 +0000 (Fri, 29 Jun 2012)
New Revision: 4713
URL: http://trac.nginx.org/nginx/changeset/4713/nginx

Log:
map: strip final dot before looking up in a map of hostnames.
(closes #182)


Modified:
trunk/src/http/modules/ngx_http_map_module.c

Modified: trunk/src/http/modules/ngx_http_map_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_map_module.c 2012-06-29 17:32:43 UTC (rev 4712)
+++ trunk/src/http/modules/ngx_http_map_module.c 2012-06-29 20:33:26 UTC (rev 4713)
@@ -110,7 +110,6 @@
{
ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data;

- size_t len;
ngx_str_t val;
ngx_http_variable_value_t *value;

@@ -121,10 +120,8 @@
return NGX_ERROR;
}

- len = val.len;
-
- if (len && map->hostnames && val.data[len - 1] == '.') {
- len--;
+ if (map->hostnames && val.len > 0 && val.data[val.len - 1] == '.') {
+ val.len--;
}

value = ngx_http_map_find(r, &map->map, &val);
@@ -281,6 +278,8 @@
map->default_value = ctx.default_value ? ctx.default_value:
&ngx_http_variable_null_value;

+ map->hostnames = ctx.hostnames;
+
hash.key = ngx_hash_key_lc;
hash.max_size = mcf->hash_max_size;
hash.bucket_size = mcf->hash_bucket_size;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4713 - trunk/src/http/modules

Anonymous User 1189 June 29, 2012 04:34PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready