mirror of
				https://github.com/openresty/openresty.git
				synced 2024-10-13 00:29:41 +00:00 
			
		
		
		
	updated the resolve-names-with-a-trailing-dot patch according to the feedback from Piotr Sikora and Ruslan Ermilov.
This commit is contained in:
		| @ -1,21 +1,21 @@ | ||||
| # HG changeset patch | ||||
| # User Yichun Zhang <agentzh@gmail.com> | ||||
| # Date 1389209699 28800 | ||||
| # Node ID 3d10680c0399cb8d2e3b601412df0495ffaab4a5 | ||||
| # Parent  c0d6eae5a1c5d16cf6a9d6a3a73656972f838eab | ||||
| # Date 1389381734 28800 | ||||
| # Node ID 4b50d1f299d8a69f3e3f7975132e1490352642fe | ||||
| # Parent  3d10680c0399cb8d2e3b601412df0495ffaab4a5 | ||||
| Resolver: added support for domain names with a trailing dot. | ||||
|  | ||||
| diff -r c0d6eae5a1c5 -r 3d10680c0399 src/core/ngx_resolver.c | ||||
| --- a/src/core/ngx_resolver.c	Fri Dec 13 20:49:52 2013 +0400 | ||||
| +++ b/src/core/ngx_resolver.c	Wed Jan 08 11:34:59 2014 -0800 | ||||
| @@ -467,6 +467,10 @@ | ||||
|      ngx_resolver_ctx_t   *next; | ||||
|      ngx_resolver_node_t  *rn; | ||||
| diff -r 3d10680c0399 -r 4b50d1f299d8 src/core/ngx_resolver.c | ||||
| --- a/src/core/ngx_resolver.c	Wed Jan 08 11:34:59 2014 -0800 | ||||
| +++ b/src/core/ngx_resolver.c	Fri Jan 10 11:22:14 2014 -0800 | ||||
| @@ -356,6 +356,10 @@ | ||||
|   | ||||
|      r = ctx->resolver; | ||||
|   | ||||
| +    if (ctx->name.len > 0 && ctx->name.data[ctx->name.len - 1] == '.') { | ||||
| +        ctx->name.len--; | ||||
| +    } | ||||
| + | ||||
|      ngx_strlow(ctx->name.data, ctx->name.data, ctx->name.len); | ||||
|      ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0, | ||||
|                     "resolve: \"%V\"", &ctx->name); | ||||
|   | ||||
|      hash = ngx_crc32_short(ctx->name.data, ctx->name.len); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user