Instead of checking on each label if we need to place a dot or not,
now it always adds a dot after a label, and reduces the resulting
length afterwards.
{
char *err;
u_char *p, *dst;
- ssize_t len;
+ size_t len;
ngx_uint_t i, n;
p = src;
- len = -1;
+ len = 0;
/*
* compression pointers allow to create endless loop, so we set limit;
return NGX_OK;
}
- if (len == -1) {
+ if (len == 0) {
ngx_str_null(name);
return NGX_OK;
}
n = *src++;
if (n == 0) {
- name->len = dst - name->data;
+ name->len = dst - name->data - 1;
return NGX_OK;
}
src = &buf[n];
} else {
- if (dst != name->data) {
- *dst++ = '.';
- }
-
ngx_strlow(dst, src, n);
dst += n;
src += n;
+ *dst++ = '.';
}
}
}