[master] 6bfbf8d62 vtc.vsl_replay(): Do not emit lines with non-numerical vxid
Nils Goroll
nils.goroll at uplex.de
Thu Feb 10 12:46:06 UTC 2022
commit 6bfbf8d627d6355892dc52aee583827532829c87
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Feb 9 11:42:58 2022 +0100
vtc.vsl_replay(): Do not emit lines with non-numerical vxid
in other words: Allow comments in the replay string
diff --git a/vmod/vmod_vtc.c b/vmod/vmod_vtc.c
index ee2e5e8f2..8c3d8e7ba 100644
--- a/vmod/vmod_vtc.c
+++ b/vmod/vmod_vtc.c
@@ -440,7 +440,7 @@ vsl_line(VRT_CTX, char *str)
VCL_INT id;
VCL_ENUM side;
const char *tag, *delim = " \t\r\n";
- char *save;
+ char *e, *save;
if (*str == '*') {
// varnishtest
@@ -451,7 +451,9 @@ vsl_line(VRT_CTX, char *str)
}
if ((str = strtok_r(str, delim, &save)) == NULL)
return;
- id = strtoll(str, NULL, 10);
+ id = strtoll(str, &e, 10);
+ if (e == str)
+ return;
if ((str = strtok_r(NULL, delim, &save)) == NULL)
return;
More information about the varnish-commit
mailing list