mirror of
https://github.com/nginx/nginx.git
synced 2025-01-21 19:53:00 +08:00
Resolver: reworked ngx_resolver_copy() copy loop.
To make the code easier to read, reworked the ngx_resolver_copy() copy loop to match the one used to calculate length. No functional changes.
This commit is contained in:
parent
bbd403a7ab
commit
f1dd1d50e0
@ -4008,15 +4008,18 @@ done:
|
|||||||
|
|
||||||
name->data = dst;
|
name->data = dst;
|
||||||
|
|
||||||
n = *src++;
|
|
||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
|
n = *src++;
|
||||||
|
|
||||||
|
if (n == 0) {
|
||||||
|
name->len = dst - name->data;
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if (n & 0xc0) {
|
if (n & 0xc0) {
|
||||||
n = ((n & 0x3f) << 8) + *src;
|
n = ((n & 0x3f) << 8) + *src;
|
||||||
src = &buf[n];
|
src = &buf[n];
|
||||||
|
|
||||||
n = *src++;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (dst != name->data) {
|
if (dst != name->data) {
|
||||||
*dst++ = '.';
|
*dst++ = '.';
|
||||||
@ -4025,13 +4028,6 @@ done:
|
|||||||
ngx_strlow(dst, src, n);
|
ngx_strlow(dst, src, n);
|
||||||
dst += n;
|
dst += n;
|
||||||
src += n;
|
src += n;
|
||||||
|
|
||||||
n = *src++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n == 0) {
|
|
||||||
name->len = dst - name->data;
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user