[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    [master] f368e540a vcc: Complete mask with VCL_MET_TASK_ALL
From:       Dridi Boukelmoune <dridi.boukelmoune () gmail ! com>
Date:       2021-01-25 18:18:07
Message-ID: 20210125181807.A28E511BE48 () lists ! varnish-cache ! org
[Download RAW message or body]


commit f368e540aaacc5de1f874bba63ca55c475df3119
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date:   Tue Jan 19 07:06:53 2021 +0100

    vcc: Complete mask with VCL_MET_TASK_ALL
    
    The rationale is that if we add another type of task in the future, for
    example probe tasks, we won't need to update the default mask for VMOD
    functions and object methods.

diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 12b8c417e..823fedc5b 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -625,6 +625,10 @@ for i in sorted(task.keys()):
     fo.write(tbl40("#define VCL_MET_TASK_%s" % i.upper(),
                    "( " + (" | \\\n\t\t\t\t\t  ").join(task[i]) + " )\n"))
 
+fo.write("\n")
+fo.write(tbl40("#define VCL_MET_TASK_ALL", "( VCL_MET_TASK_"))
+fo.write(" | \\\n\t\t\t\t\t  VCL_MET_TASK_".join(map(str.upper, task.keys())))
+fo.write(" )")
 
 fo.write("\n/* VCL Returns */\n")
 n = 1
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index 4ecd217c6..361357b32 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -119,7 +119,7 @@ func_sym(struct vcc *tl, vcc_kind_t kind, const struct symbol *psym,
 	assert(v->type == VJSN_STRING);
 	sym->type = VCC_Type(v->value);
 	AN(sym->type);
-	sym->r_methods = VCL_MET_TASK_C|VCL_MET_TASK_B|VCL_MET_TASK_H;
+	sym->r_methods = VCL_MET_TASK_ALL;
 }
 
 static void
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic