Commit 4127a37a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add VRT_synth_blob(). Rename VRT_synth_page() to VRT_synth_strands()

(VRT_synth_page() still works, but is now deprecated.)
parent d58c4baf
......@@ -817,7 +817,7 @@ VRT_Rollback(VRT_CTX, VCL_HTTP hp)
/*--------------------------------------------------------------------*/
VCL_VOID
VRT_synth_page(VRT_CTX, VCL_STRANDS s)
VRT_synth_strands(VRT_CTX, VCL_STRANDS s)
{
struct vsb *vsb;
int i;
......@@ -832,6 +832,22 @@ VRT_synth_page(VRT_CTX, VCL_STRANDS s)
}
}
VCL_VOID
VRT_synth_blob(VRT_CTX, VCL_BLOB b)
{
struct vsb *vsb;
CAST_OBJ_NOTNULL(vsb, ctx->specific, VSB_MAGIC);
if (b->len > 0 && b->blob != NULL)
VSB_bcat(vsb, b->blob, b->len);
}
VCL_VOID
VRT_synth_page(VRT_CTX, VCL_STRANDS s)
{
VRT_synth_strands(ctx, s);
}
/*--------------------------------------------------------------------*/
static VCL_STRING
......
......@@ -53,6 +53,8 @@
* binary/load-time compatible, increment MAJOR version
*
* 13.0 (2021-03-15)
* Move VRT_synth_page() to deprecated status
* Add VRT_synth_strands() and VRT_synth_blob()
* struct vrt_type now produced by generate.py
* VRT_acl_log() moved to VPI_acl_log()
* VRT_Endpoint_Clone() added.
......@@ -546,7 +548,8 @@ VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS);
VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP);
/* Synthetic pages */
VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS);
VCL_VOID VRT_synth_strands(VRT_CTX, VCL_STRANDS);
VCL_VOID VRT_synth_blob(VRT_CTX, VCL_BLOB);
/***********************************************************************
* VDI - Director API
......@@ -646,9 +649,10 @@ struct vclref * VRT_VCL_Prevent_Discard(VRT_CTX, const char *);
void VRT_VCL_Allow_Discard(struct vclref **);
/***********************************************************************
* Deprecated interfaces, do not use
* Deprecated interfaces, do not use, they will disappear at some point.
*/
VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS);
extern const void * const vrt_magic_string_end;
extern const void * const vrt_magic_string_unset;
int VRT_Stv(const char *nm);
......@@ -387,7 +387,7 @@ vcc_act_synthetic(struct vcc *tl, struct token *t, struct symbol *sym)
ERRCHK(tl);
vcc_NextToken(tl);
Fb(tl, 1, "VRT_synth_page(ctx, ");
Fb(tl, 1, "VRT_synth_strands(ctx, ");
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