Welcome! Log In Create A New Profile

Advanced

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

Anonymous User
December 14, 2012 02:58PM
Author: ru
Date: 2012-12-14 19:56:03 +0000 (Fri, 14 Dec 2012)
New Revision: 4969
URL: http://trac.nginx.org/nginx/changeset/4969/nginx

Log:
Geo: fixed the "ranges" without ranges case.

The following configuration returned an empty value for $geo:

geo $geo {
ranges;
default default;
}


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

Modified: trunk/src/http/modules/ngx_http_geo_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_geo_module.c 2012-12-14 19:35:37 UTC (rev 4968)
+++ trunk/src/http/modules/ngx_http_geo_module.c 2012-12-14 19:56:03 UTC (rev 4969)
@@ -189,19 +189,22 @@

*v = *ctx->u.high.default_value;

- addr = ngx_http_geo_addr(r, ctx);
-
- range = ctx->u.high.low[addr >> 16];
-
- if (range) {
- n = addr & 0xffff;
- do {
- if (n >= (ngx_uint_t) range->start && n <= (ngx_uint_t) range->end)
- {
- *v = *range->value;
- break;
- }
- } while ((++range)->value);
+ if (ctx->u.high.low) {
+ addr = ngx_http_geo_addr(r, ctx);
+
+ range = ctx->u.high.low[addr >> 16];
+
+ if (range) {
+ n = addr & 0xffff;
+ do {
+ if (n >= (ngx_uint_t) range->start
+ && n <= (ngx_uint_t) range->end)
+ {
+ *v = *range->value;
+ break;
+ }
+ } while ((++range)->value);
+ }
}

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -384,9 +387,9 @@
geo->proxies = ctx.proxies;
geo->proxy_recursive = ctx.proxy_recursive;

- if (ctx.high.low) {
+ if (ctx.ranges) {

- if (!ctx.binary_include) {
+ if (ctx.high.low && !ctx.binary_include) {
for (i = 0; i < 0x10000; i++) {
a = (ngx_array_t *) ctx.high.low[i];


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

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

Anonymous User 892 December 14, 2012 02:58PM



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

Online Users

Guests: 212
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