2
0
mirror of https://github.com/soheilhy/cmux.git synced 2024-09-20 02:55:46 +08:00
Commit Graph

11 Commits

Author SHA1 Message Date
Tamir Duberstein
9a9119af9d fix flaky test TestErrorHandler
Before this change, this test would fail after about 50 runs. After
this change, I was able to run it 200 times without failure.
2016-02-23 11:06:01 -05:00
Tamir Duberstein
15b1cf90b1 TestErrorHandler: assert that the error handler runs
Also fixes a race condition using an atomic and adds the race detector
to Travis CI.
2016-02-22 22:33:02 -05:00
Tamir Duberstein
e5e53dfc73 avoid (*testing.T).FailNow in non-main goroutines 2016-02-22 22:13:34 -05:00
Tamir Duberstein
ffd8d50a7c fix test-only goroutine leaks
This makes real test failures' stack traces much easier to read.
2016-02-22 22:13:34 -05:00
Tamir Duberstein
5746da9df6 DRY 2016-02-21 12:59:08 -05:00
Tamir Duberstein
ecc37f82cd let the kernel assign ports 2016-02-21 12:07:55 -05:00
Tamir Duberstein
92a63c4fce errcheck
go/src/github.com/soheilhy/cmux/cmux.go:127:13	c.Close()
go/src/github.com/soheilhy/cmux/cmux.go:134:9	c.Close()
go/src/github.com/soheilhy/cmux/cmux.go:137:15	m.root.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:43:9	s.Serve(l)
go/src/github.com/soheilhy/cmux/cmux_test.go:52:20	defer r.Body.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:72:12	s.Register(TestRPCRcvr{})
go/src/github.com/soheilhy/cmux/cmux_test.go:103:15	defer l.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:109:15	go muxl.Serve()
go/src/github.com/soheilhy/cmux/cmux_test.go:116:20	defer r.Body.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:125:15	defer l.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:133:15	go muxl.Serve()
go/src/github.com/soheilhy/cmux/cmux_test.go:141:15	defer l.Close()
go/src/github.com/soheilhy/cmux/cmux_test.go:147:15	go muxl.Serve()
go/src/github.com/soheilhy/cmux/example_recursive_test.go:27:9	s.Serve(l)
go/src/github.com/soheilhy/cmux/example_recursive_test.go:56:12	s.Register(&RecursiveRPCRcvr{})
go/src/github.com/soheilhy/cmux/example_recursive_test.go:88:15	go tlsm.Serve()
go/src/github.com/soheilhy/cmux/example_recursive_test.go:89:12	tcpm.Serve()
go/src/github.com/soheilhy/cmux/example_test.go:30:9	s.Serve(l)
go/src/github.com/soheilhy/cmux/example_test.go:34:9	io.Copy(ws, ws)
go/src/github.com/soheilhy/cmux/example_test.go:41:9	s.Serve(l)
go/src/github.com/soheilhy/cmux/example_test.go:53:12	s.Register(&ExampleRPCRcvr{})
go/src/github.com/soheilhy/cmux/example_test.go:68:13	grpcs.Serve(l)
go/src/github.com/soheilhy/cmux/example_test.go:97:9	m.Serve()
go/src/github.com/soheilhy/cmux/example_tls_test.go:24:9	s.Serve(l)
go/src/github.com/soheilhy/cmux/example_tls_test.go:69:9	m.Serve()
go/src/github.com/soheilhy/cmux/matchers.go:151:14	hdec.Write(f.HeaderBlockFragment())
2016-02-21 12:02:37 -05:00
Soheil Hassas Yeganeh
89dd8ce1fd Return an error in Accept() when root is closed.
As reported in #4, when the root listener is closed, calling Accept
on mux'd listeners would block forever, instead of returning an error.
This is because of a bug introduced in b90740d.

This commit fixes #4 by selecting on both donec and connc of muxed
listeners.

Added a test case to guard against this issue.
2015-12-19 22:28:37 -05:00
Soheil Hassas Yeganeh
b90740dfa9 Fix send on closed channel
If a matcher go-routine mateches a connection after the root
listener was closed, cmux will panic since all connection channels
will be closed. This commit avoids closing connection channels but
signals the matcher go-routines that the listener is closed via
a done channel.

Tested: Added a test case for this issue.
2015-08-30 21:10:18 -04:00
Soheil Hassas Yeganeh
6194168d4e Remove the bugos http2.Configure from tests
http2.Configure is not functional with cmux. Asked for
exporting http2.Server.HandleConn().
2015-07-29 17:23:53 -04:00
Soheil Hassas Yeganeh
754f5b897d Initial commit 2015-07-29 13:49:26 -04:00