mirror of
https://github.com/nginx/nginx.git
synced 2026-05-13 09:36:42 +00: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
3893b483ed
commit
52601fc5dc
1 changed files with 7 additions and 11 deletions
|
|
@ -4008,15 +4008,18 @@ done:
|
|||
|
||||
name->data = dst;
|
||||
|
||||
n = *src++;
|
||||
|
||||
for ( ;; ) {
|
||||
n = *src++;
|
||||
|
||||
if (n == 0) {
|
||||
name->len = dst - name->data;
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
if (n & 0xc0) {
|
||||
n = ((n & 0x3f) << 8) + *src;
|
||||
src = &buf[n];
|
||||
|
||||
n = *src++;
|
||||
|
||||
} else {
|
||||
if (dst != name->data) {
|
||||
*dst++ = '.';
|
||||
|
|
@ -4025,13 +4028,6 @@ done:
|
|||
ngx_strlow(dst, src, n);
|
||||
dst += n;
|
||||
src += n;
|
||||
|
||||
n = *src++;
|
||||
}
|
||||
|
||||
if (n == 0) {
|
||||
name->len = dst - name->data;
|
||||
return NGX_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue