Commit f0de32ec authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Convert VRT_synth_page() to take STRANDS

parent 5db1061f
......@@ -675,26 +675,19 @@ VRT_Rollback(VRT_CTX, VCL_HTTP hp)
/*--------------------------------------------------------------------*/
VCL_VOID
VRT_synth_page(VRT_CTX, const char *str, ...)
VRT_synth_page(VRT_CTX, VCL_STRANDS s)
{
va_list ap;
const char *p;
struct vsb *vsb;
int i;
CAST_OBJ_NOTNULL(vsb, ctx->specific, VSB_MAGIC);
va_start(ap, str);
p = str;
while (p != vrt_magic_string_end) {
if (p == NULL)
p = "(null)";
if (VSB_cat(vsb, p)) {
VRT_fail(ctx, "synthetic(): %s",
vstrerror(VSB_error(vsb)));
break;
}
p = va_arg(ap, const char *);
AN(s);
for (i = 0; i < s->n; i++) {
if (s->p[i] != NULL)
VSB_cat(vsb, s->p[i]);
else
VSB_cat(vsb, "(null)");
}
va_end(ap);
}
/*--------------------------------------------------------------------*/
......
......@@ -52,6 +52,7 @@
* binary/load-time compatible, increment MAJOR version
*
* unreleased (planned for 2019-09-15)
* VRT_synth_page now takes STRANDS argument
* VRT_hashdata() now takes STRANDS argument
* VCL_BOOL VRT_Strands2Bool(VCL_STRANDS) added.
* VRT_BundleStrands() moved to vcc_interface.h
......@@ -450,7 +451,7 @@ VCL_BLOB VRT_blob(VRT_CTX, const char *, const void *, size_t, unsigned);
VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP);
/* Synthetic pages */
VCL_VOID VRT_synth_page(VRT_CTX, const char *, ...);
VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS);
/* Backend related */
VCL_BACKEND VRT_new_backend(VRT_CTX, const struct vrt_backend *);
......
......@@ -375,7 +375,7 @@ vcc_act_synthetic(struct vcc *tl, struct token *t, struct symbol *sym)
vcc_NextToken(tl);
Fb(tl, 1, "VRT_synth_page(ctx, ");
vcc_Expr(tl, STRING_LIST);
vcc_Expr(tl, STRANDS);
ERRCHK(tl);
Fb(tl, 1, ");\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment