[master] e9deae59d Use VSL_OVERHEAD instead of 2
Poul-Henning Kamp
phk at FreeBSD.org
Tue Nov 15 08:31:06 UTC 2022
commit e9deae59d0b093be63b7d66bcb42b54060055cc1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Nov 15 08:29:59 2022 +0000
Use VSL_OVERHEAD instead of 2
diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 8c24a7521..cf0683606 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -93,7 +93,7 @@ struct synth {
VTAILQ_ENTRY(synth) list;
size_t offset;
- uint32_t data[2 + 64 / sizeof (uint32_t)];
+ uint32_t data[VSL_OVERHEAD + 64 / sizeof (uint32_t)];
};
VTAILQ_HEAD(synthhead, synth);
@@ -1036,8 +1036,8 @@ vtx_synth_rec(struct vtx *vtx, unsigned tag, const char *fmt, ...)
ALLOC_OBJ(synth, SYNTH_MAGIC);
AN(synth);
- buf = (char *)&synth->data[2];
- buflen = sizeof (synth->data) - 2 * sizeof (uint32_t);
+ buf = (char *)&synth->data[VSL_OVERHEAD];
+ buflen = sizeof (synth->data) - VSL_OVERHEAD * sizeof (uint32_t);
va_start(ap, fmt);
l = vsnprintf(buf, buflen, fmt, ap);
assert(l >= 0);
More information about the varnish-commit
mailing list