mirror of
https://github.com/nginx/nginx.git
synced 2025-06-28 02:02:50 +08:00
fix "PTR ." case in address resolver
This commit is contained in:
parent
64bfa87e73
commit
70966c154f
@ -1902,6 +1902,12 @@ done:
|
|||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len == -1) {
|
||||||
|
name->len = 0;
|
||||||
|
name->data = NULL;
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
dst = ngx_resolver_alloc(r, len);
|
dst = ngx_resolver_alloc(r, len);
|
||||||
if (dst == NULL) {
|
if (dst == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
@ -124,6 +124,19 @@ ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx)
|
|||||||
return;
|
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";
|
c->log->action = "in resolving client hostname";
|
||||||
|
|
||||||
s->host.data = ngx_pstrdup(c->pool, &ctx->name);
|
s->host.data = ngx_pstrdup(c->pool, &ctx->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user