[master] 94af15e8e doc: Mention the VCL standalone return statement

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jan 26 09:36:08 UTC 2021


commit 94af15e8ed993377ac7cae187f3e70ffb33c9d42
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Jan 26 10:30:31 2021 +0100

    doc: Mention the VCL standalone return statement
    
    Salvaged from #3503

diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index 00be68429..9dc04d6ca 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -434,6 +434,17 @@ The ongoing ``vcl_*`` subroutine execution ends when a
 The *<action>* specifies how execution should proceed. The context
 defines which actions are available.
 
+It is possible to exit a subroutine that is not part of the built-in ones
+using a simple ``return`` statement without specifying an action. It exits
+the subroutine without transitioning to a different state::
+
+    sub filter_cookies {
+        if (!req.http.cookie) {
+            return;
+        }
+        # complex cookie filtering
+    }
+
 Multiple subroutines
 ~~~~~~~~~~~~~~~~~~~~
 
@@ -538,7 +549,7 @@ HISTORY
 VCL was developed by Poul-Henning Kamp in cooperation with Verdens
 Gang AS, Redpill Linpro and Varnish Software.  This manual page is
 written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland,
-Kristian Lyngstøl, Lasse Karstensen and possibly others.
+Kristian Lyngstøl, Lasse Karstensen and others.
 
 COPYRIGHT
 =========


More information about the varnish-commit mailing list