Commit 5db1061f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Change VRT_hashdata() to take STRANDS

parent dffae17c
......@@ -555,23 +555,16 @@ VRT_fail(VRT_CTX, const char *fmt, ...)
*/
VCL_VOID
VRT_hashdata(VRT_CTX, const char *str, ...)
VRT_hashdata(VRT_CTX, VCL_STRANDS s)
{
va_list ap;
const char *p;
int i;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
AN(ctx->specific);
HSH_AddString(ctx->req, ctx->specific, str);
va_start(ap, str);
while (1) {
p = va_arg(ap, const char *);
if (p == vrt_magic_string_end)
break;
HSH_AddString(ctx->req, ctx->specific, p);
}
va_end(ap);
AN(s);
for (i = 0; i < s->n; i++)
HSH_AddString(ctx->req, ctx->specific, s->p[i]);
/*
* Add a 'field-separator' to make it more difficult to
* manipulate the hash.
......
......@@ -52,6 +52,7 @@
* binary/load-time compatible, increment MAJOR version
*
* unreleased (planned for 2019-09-15)
* VRT_hashdata() now takes STRANDS argument
* VCL_BOOL VRT_Strands2Bool(VCL_STRANDS) added.
* VRT_BundleStrands() moved to vcc_interface.h
* VRT_VCL_{Busy|Unbusy} changed to VRT_VCL_{Prevent|Allow}_Cold
......@@ -438,7 +439,7 @@ VCL_VOID VRT_hit_for_pass(VRT_CTX, VCL_DURATION);
VCL_VOID VRT_SetHdr(VRT_CTX, VCL_HEADER, const char *, ...);
VCL_VOID VRT_handling(VRT_CTX, unsigned hand);
VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3);
VCL_VOID VRT_hashdata(VRT_CTX, const char *str, ...);
VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS);
/* Simple stuff */
int VRT_strcmp(const char *s1, const char *s2);
......
......@@ -193,7 +193,7 @@ vcc_act_hash_data(struct vcc *tl, struct token *t, struct symbol *sym)
SkipToken(tl, '(');
Fb(tl, 1, "VRT_hashdata(ctx,\n ");
vcc_Expr(tl, STRING_LIST);
vcc_Expr(tl, STRANDS);
ERRCHK(tl);
Fb(tl, 1, ");\n");
SkipToken(tl, ')');
......
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