mirror of
https://github.com/soheilhy/cmux.git
synced 2024-11-14 11:31:28 +08:00
unexport prefixByteMatcher
This commit is contained in:
parent
4f90533583
commit
9a3402ad7a
@ -38,9 +38,7 @@ func PrefixMatcher(strs ...string) Matcher {
|
|||||||
return pt.matchPrefix
|
return pt.matchPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrefixByteMatcher returns a matcher that matches a connection if it
|
func prefixByteMatcher(list ...[]byte) Matcher {
|
||||||
// starts with any of the []byte in list.
|
|
||||||
func PrefixByteMatcher(list ...[]byte) Matcher {
|
|
||||||
pt := newPatriciaTree(list...)
|
pt := newPatriciaTree(list...)
|
||||||
return pt.matchPrefix
|
return pt.matchPrefix
|
||||||
}
|
}
|
||||||
@ -83,7 +81,7 @@ func TLS(versions ...int) Matcher {
|
|||||||
for _, v := range versions {
|
for _, v := range versions {
|
||||||
prefixes = append(prefixes, []byte{22, byte(v >> 8 & 0xff), byte(v & 0xff)})
|
prefixes = append(prefixes, []byte{22, byte(v >> 8 & 0xff), byte(v & 0xff)})
|
||||||
}
|
}
|
||||||
return PrefixByteMatcher(prefixes...)
|
return prefixByteMatcher(prefixes...)
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxHTTPRead = 4096
|
const maxHTTPRead = 4096
|
||||||
|
Loading…
Reference in New Issue
Block a user