mirror of
https://github.com/soheilhy/cmux.git
synced 2025-10-18 05:08:08 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
711042c095 | ||
|
ac00452023 |
@@ -81,7 +81,7 @@ func (l *chanListener) Accept() (net.Conn, error) {
|
||||
}
|
||||
|
||||
func testListener(t *testing.T) (net.Listener, func()) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -659,7 +659,9 @@ func TestClose(t *testing.T) {
|
||||
if err != ErrListenerClosed {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := c2.Read([]byte{}); err != io.ErrClosedPipe {
|
||||
// The error is either io.ErrClosedPipe or net.OpError wrapping
|
||||
// a net.pipeError depending on the go version.
|
||||
if _, err := c2.Read([]byte{}); !strings.Contains(err.Error(), "closed") {
|
||||
t.Fatalf("connection is not closed and is leaked: %v", err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user