Mercurial > hg > nginx
changeset 3298:847ab5a32307
fix "PTR ." case in address resolver
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 09 Nov 2009 18:04:05 +0000 |
parents | ebc5384479b4 |
children | 0b6277a58a2d |
files | src/core/ngx_resolver.c src/mail/ngx_mail_smtp_handler.c |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_resolver.c Mon Nov 09 17:45:56 2009 +0000 +++ b/src/core/ngx_resolver.c Mon Nov 09 18:04:05 2009 +0000 @@ -1902,6 +1902,12 @@ return NGX_OK; } + if (len == -1) { + name->len = 0; + name->data = NULL; + return NGX_OK; + } + dst = ngx_resolver_alloc(r, len); if (dst == NULL) { return NGX_ERROR;
--- a/src/mail/ngx_mail_smtp_handler.c Mon Nov 09 17:45:56 2009 +0000 +++ b/src/mail/ngx_mail_smtp_handler.c Mon Nov 09 18:04:05 2009 +0000 @@ -124,6 +124,19 @@ return; } + if (ctx->name.len == 0) { + ngx_log_error(NGX_LOG_ERR, c->log, 0, + "%V has been resolved to zero name", &c->addr_text); + + s->host = smtp_unavailable; + + ngx_resolve_addr_done(ctx); + + ngx_mail_smtp_greeting(s, s->connection); + + return; + } + c->log->action = "in resolving client hostname"; s->host.data = ngx_pstrdup(c->pool, &ctx->name);