static ngx_int_t
ngx_resolver_copy(ngx_resolver_t *r, ngx_str_t *name, u_char *buf, u_char *src,
    u_char *last)
{
    char        *err;
    u_char      *p, *dst;
    ssize_t      len;
    ngx_uint_t   i, n;
    p = src;
    len = -1;
    for (i = 0; i < 128; i++) {
        n = *p++;
        if (n == 0) {
            goto done;
        }
        if (n & 0xc0) {
            n = ((n & 0x3f) << 8) + *p;
            p = &buf[n];
        } else {
            len += 1 + n;
            p = &p[n];
        }
        if (p >= last) {
            err = "name is out of response";
            goto invalid;
        }
    }
    err = "compression pointers loop";
invalid:
    ngx_log_error(r->log_level, r->log, 0, err);
    return NGX_ERROR;
done:
    if (name == NULL) {
        return NGX_OK;
    }
    dst = ngx_resolver_alloc(r, len);
    if (dst == NULL) {
        return NGX_ERROR;
    }
    name->data = dst;
    n = *src++;
    for ( ;; ) {
        if (n != 0xc0) {
            ngx_memcpy(dst, src, n);
            dst += n;
            src += n;
            n = *src++;
            if (n != 0) {
                *dst++ = '.';
            }
        } else {
            n = ((n & 0x3f) << 8) + *src;
            src = &buf[n];
            n = *src++;
        }
        if (n == 0) {
            name->len = dst - name->data;
            return NGX_OK;
        }
    }
}
['static ngx_int_t\nngx_resolver_copy(ngx_resolver_t *r, ngx_str_t *name, u_char *buf, u_char *src,\n    u_char *last)\n{\n    char        *err;\n    u_char      *p, *dst;\n    ssize_t      len;\n    ngx_uint_t   i, n;\n    p = src;\n    len = -1;\n    for (i = 0; i < 128; i++) {\n        n = *p++;\n        if (n == 0) {\n            goto done;\n        }\n        if (n & 0xc0) {\n            n = ((n & 0x3f) << 8) + *p;\n            p = &buf[n];\n        } else {\n            len += 1 + n;\n            p = &p[n];\n        }\n        if (p >= last) {\n            err = "name is out of response";\n            goto invalid;\n        }\n    }\n    err = "compression pointers loop";\ninvalid:\n    ngx_log_error(r->log_level, r->log, 0, err);\n    return NGX_ERROR;\ndone:\n    if (name == NULL) {\n        return NGX_OK;\n    }\n    dst = ngx_resolver_alloc(r, len);\n    if (dst == NULL) {\n        return NGX_ERROR;\n    }\n    name->data = dst;\n    n = *src++;\n    for ( ;; ) {\n        if (n != 0xc0) {\n            ngx_memcpy(dst, src, n);\n            dst += n;\n            src += n;\n            n = *src++;\n            if (n != 0) {\n                *dst++ = \'.\';\n            }\n        } else {\n            n = ((n & 0x3f) << 8) + *src;\n            src = &buf[n];\n            n = *src++;\n        }\n        if (n == 0) {\n            name->len = dst - name->data;\n            return NGX_OK;\n        }\n    }\n}']