diff --git a/server.go b/server.go index 1c42b6eff..d71c094e2 100644 --- a/server.go +++ b/server.go @@ -279,7 +279,7 @@ func (s *Server) serveNewHTTP2Transport(c net.Conn, authInfo credentials.AuthInf return } if !s.addConn(st) { - c.Close() + st.Close() return } s.serveStreams(st) diff --git a/test/end2end_test.go b/test/end2end_test.go index f1c7b426a..9461cd6ee 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -1354,7 +1354,7 @@ func interestingGoroutines() (gs []string) { return } -var failOnLeaks = flag.Bool("fail_on_leaks", false, "Fail tests if goroutines leak.") +var failOnLeaks = flag.Bool("fail_on_leaks", true, "Fail tests if goroutines leak.") // leakCheck snapshots the currently-running goroutines and returns a // function to be run at the end of tests to see whether any