openresty/patches/nginx-1.5.8-resolve-names-w...

22 lines
696 B
C

# HG changeset patch
# User Yichun Zhang <agentzh@gmail.com>
# Date 1389381734 28800
# Node ID 4b50d1f299d8a69f3e3f7975132e1490352642fe
# Parent 3d10680c0399cb8d2e3b601412df0495ffaab4a5
Resolver: added support for domain names with a trailing dot.
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_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0,
"resolve: \"%V\"", &ctx->name);