# HG changeset patch # User Igor Sysoev # Date 1257789845 0 # Node ID 847ab5a323079b381a48fbd007068f6199f0a20f # Parent ebc5384479b4979b6dae22bfee91a69c69411177 fix "PTR ." case in address resolver diff -r ebc5384479b4 -r 847ab5a32307 src/core/ngx_resolver.c --- 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; diff -r ebc5384479b4 -r 847ab5a32307 src/mail/ngx_mail_smtp_handler.c --- 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);