mirror of
https://github.com/nginx/nginx.git
synced 2025-06-27 17:22:48 +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;
|
||||
}
|
||||
|
||||
if (len == -1) {
|
||||
name->len = 0;
|
||||
name->data = NULL;
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
dst = ngx_resolver_alloc(r, len);
|
||||
if (dst == NULL) {
|
||||
return NGX_ERROR;
|
||||
|
@ -124,6 +124,19 @@ ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user