Welcome! Log In Create A New Profile

Advanced

[nginx] Resolver: improved error messages (ticket #2024).

Maxim Dounin
September 28, 2020 12:16PM
details: https://hg.nginx.org/nginx/rev/8fe7ebe5adc4
branches:
changeset: 7718:8fe7ebe5adc4
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Sep 28 17:41:22 2020 +0300
description:
Resolver: improved error messages (ticket #2024).

diffstat:

src/core/ngx_resolver.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)

diffs (144 lines):

diff -r e3e8b8234f05 -r 8fe7ebe5adc4 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Mon Sep 28 17:07:48 2020 +0300
+++ b/src/core/ngx_resolver.c Mon Sep 28 17:41:22 2020 +0300
@@ -1918,7 +1918,7 @@ ngx_resolver_process_a(ngx_resolver_t *r

if (rn == NULL) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected response for %V", &name);
+ "unexpected DNS response for %V", &name);
ngx_resolver_free(r, name.data);
goto failed;
}
@@ -1930,7 +1930,7 @@ ngx_resolver_process_a(ngx_resolver_t *r

if (rn->query6 == NULL || rn->naddrs6 != (u_short) -1) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected response for %V", &name);
+ "unexpected DNS response for %V", &name);
ngx_resolver_free(r, name.data);
goto failed;
}
@@ -1949,7 +1949,7 @@ ngx_resolver_process_a(ngx_resolver_t *r

if (rn->query == NULL || rn->naddrs != (u_short) -1) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected response for %V", &name);
+ "unexpected DNS response for %V", &name);
ngx_resolver_free(r, name.data);
goto failed;
}
@@ -1964,7 +1964,7 @@ ngx_resolver_process_a(ngx_resolver_t *r

if (ident != qident) {
ngx_log_error(r->log_level, r->log, 0,
- "wrong ident %ui response for %V, expect %ui",
+ "wrong ident %ui in DNS response for %V, expect %ui",
ident, &name, qident);
ngx_resolver_free(r, name.data);
goto failed;
@@ -2149,7 +2149,7 @@ ngx_resolver_process_a(ngx_resolver_t *r

if (class != 1) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR class %ui", class);
+ "unexpected RR class %ui in DNS response", class);
goto failed;
}

@@ -2218,7 +2218,7 @@ ngx_resolver_process_a(ngx_resolver_t *r
default:

ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR type %ui", type);
+ "unexpected RR type %ui in DNS response", type);
}

i += len;
@@ -2567,7 +2567,7 @@ ngx_resolver_process_srv(ngx_resolver_t

if (rn == NULL || rn->query == NULL) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected response for %V", &name);
+ "unexpected DNS response for %V", &name);
ngx_resolver_free(r, name.data);
goto failed;
}
@@ -2581,7 +2581,7 @@ ngx_resolver_process_srv(ngx_resolver_t

if (ident != qident) {
ngx_log_error(r->log_level, r->log, 0,
- "wrong ident %ui response for %V, expect %ui",
+ "wrong ident %ui in DNS response for %V, expect %ui",
ident, &name, qident);
ngx_resolver_free(r, name.data);
goto failed;
@@ -2691,7 +2691,7 @@ ngx_resolver_process_srv(ngx_resolver_t

if (class != 1) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR class %ui", class);
+ "unexpected RR class %ui in DNS response", class);
goto failed;
}

@@ -2734,7 +2734,7 @@ ngx_resolver_process_srv(ngx_resolver_t
default:

ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR type %ui", type);
+ "unexpected RR type %ui in DNS response", type);
}

i += len;
@@ -3165,7 +3165,7 @@ valid:

if (rn == NULL || rn->query == NULL) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected response for %V", &name);
+ "unexpected DNS response for %V", &name);
ngx_resolver_free(r, name.data);
goto failed;
}
@@ -3174,7 +3174,7 @@ valid:

if (ident != qident) {
ngx_log_error(r->log_level, r->log, 0,
- "wrong ident %ui response for %V, expect %ui",
+ "wrong ident %ui in DNS response for %V, expect %ui",
ident, &name, qident);
ngx_resolver_free(r, name.data);
goto failed;
@@ -3256,7 +3256,7 @@ valid:

if (class != 1) {
ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR class %ui", class);
+ "unexpected RR class %ui in DNS response", class);
goto failed;
}

@@ -3283,7 +3283,7 @@ valid:
default:

ngx_log_error(r->log_level, r->log, 0,
- "unexpected RR type %ui", type);
+ "unexpected RR type %ui in DNS response", type);
}

i += len;
@@ -3952,12 +3952,12 @@ ngx_resolver_copy(ngx_resolver_t *r, ngx
}

if (p >= last) {
- err = "name is out of response";
+ err = "name is out of DNS response";
goto invalid;
}
}

- err = "compression pointers loop";
+ err = "compression pointers loop in DNS response";

invalid:

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Resolver: improved error messages (ticket #2024).

Maxim Dounin 84 September 28, 2020 12:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 78
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready