VRT_TIME_string to trigger VCL failure for unformatable time

as per pow-wow decision

Ref #3308
parent ffd88acd
......@@ -837,17 +837,17 @@ VCL_STRING v_matchproto_()
VRT_TIME_string(VRT_CTX, VCL_TIME t)
{
char *p;
uintptr_t snapshot;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
snapshot = WS_Snapshot(ctx->ws);
p = WS_Alloc(ctx->ws, VTIM_FORMAT_SIZE);
if (p != NULL) {
VTIM_format(t, p);
if (*p == '\0') {
p = NULL;
WS_Reset(ctx->ws, snapshot);
}
if (p == NULL) {
VRT_fail(ctx, "Workspace overflow");
return (NULL);
}
VTIM_format(t, p);
if (*p == '\0') {
VRT_fail(ctx, "Unformatable VCL_TIME");
return (NULL);
}
return (p);
}
......
......@@ -16,5 +16,5 @@ varnish v1 -vcl+backend {
client c1 {
txreq
rxresp
expect resp.http.ts == ""
expect resp.status == 503
} -run
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