Commit 5c7ef404 authored by Geoff Simmons's avatar Geoff Simmons

Remove the obsolete upper bound on VCL symbol lengths.

parent 803148b9
......@@ -190,22 +190,3 @@ func TestCanoncial(t *testing.T) {
}
}
}
var names = []string{
"vk8s_cafe_example_com_url",
"vk8s_very_long_name_that_breaks_the_symbol_length_upper_bound",
}
func TestBound(t *testing.T) {
for _, n := range names {
if len(bound(n, maxSymLen)) > maxSymLen {
t.Errorf("bound(\"%s\", %d) not shortened as "+
"expected: len(\"%s\")=%d", n, maxSymLen,
bound(n, maxSymLen), len(bound(n, maxSymLen)))
}
if len(n) <= maxSymLen && n != bound(n, maxSymLen) {
t.Errorf("bound(\"%s\", %d) exp=\"%s\" got=\"%s\"",
n, maxSymLen, n, bound(n, maxSymLen))
}
}
}
......@@ -78,11 +78,6 @@ func (spec Spec) GetSrc() (string, error) {
// The following functions are re-used in the function maps of more
// than one template.
// maxSymLen is a workaround for Varnish issue #2880
// https://github.com/varnishcache/varnish-cache/issues/2880
// Will be unnecssary as of the March 2019 release
const maxSymLen = 46
var vclIllegal = regexp.MustCompile("[^[:word:]-]+")
func replIllegal(ill []byte) []byte {
......@@ -113,8 +108,7 @@ func mangle(s string) string {
}
prefixed := "vk8s_" + s
bytes := []byte(prefixed)
mangled := vclIllegal.ReplaceAllFunc(bytes, replIllegal)
return bound(string(mangled), maxSymLen)
return string(vclIllegal.ReplaceAllFunc(bytes, replIllegal))
}
func backendName(svc Service, addr Address) string {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment