2
0
mirror of https://github.com/soheilhy/cmux.git synced 2024-11-10 11:41:52 +08:00

Fix bug matchers are ignored except last one

This commit is contained in:
Yuki Ito 2018-01-23 13:57:52 +09:00 committed by Soheil Hassas Yeganeh
parent be5b383fd5
commit e96bd75f84

View File

@ -115,7 +115,8 @@ type cMux struct {
func matchersToMatchWriters(matchers []Matcher) []MatchWriter { func matchersToMatchWriters(matchers []Matcher) []MatchWriter {
mws := make([]MatchWriter, 0, len(matchers)) mws := make([]MatchWriter, 0, len(matchers))
for _, m := range matchers { for _, _m := range matchers {
m := _m
mws = append(mws, func(w io.Writer, r io.Reader) bool { mws = append(mws, func(w io.Writer, r io.Reader) bool {
return m(r) return m(r)
}) })