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