[master] aba2855cb Check for VRT_fail before setting handling on return() in VCL
Martin Blix Grydeland
martin at varnish-software.com
Tue May 5 11:39:07 UTC 2020
commit aba2855cb947dd5aa9ca1a9680c330264b23925d
Author: Martin Blix Grydeland <martin at 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.
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 8fa48b37c..40ad52060 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -366,6 +366,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym)
}
}
ERRCHK(tl);
+ Fb(tl, 1, "END_;\n");
if (hand == VCL_RET_FAIL)
Fb(tl, 1, "VRT_fail(ctx, \"Failed from VCL\");\n");
else
More information about the varnish-commit
mailing list