Mailing List Archive

[6.0] 9e6f8a33b Check for VRT_fail before setting handling on return() in VCL
commit 9e6f8a33beceba66bfc237a0c1c68182833f72d0
Author: Martin Blix Grydeland <martin@varnish-software.com>
Date: Fri Apr 24 16:28:35 2020 +0200

Check for VRT_fail before setting handling on return() in VCL

The compound statement doing return() in VCL may have failed for some
reason, for example running out of workspace while putting together the
reason field. The fail handling would be overwritten by the forced
handling at the end of the generated code for a return statement.

This patch adds a test for the failure condition before forcing the
handling to the result of the return statement.

Conflicts:
lib/libvcc/vcc_action.c

diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 210101feb..1dd9e88cf 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -350,6 +350,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym)
}
}
ERRCHK(tl);
+ Fb(tl, 1, "END_;\n");
Fb(tl, 1, "VRT_handling(ctx, VCL_RET_%s);\n", h);
SkipToken(tl, ')');
SkipToken(tl, ';');
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit