Remove unnecessary function handleStreamSuspension (#1468)

This commit is contained in:
dfawley
2017-08-25 13:51:53 -07:00
committed by GitHub
parent e98913eca1
commit fa59b779e8

View File

@ -116,13 +116,6 @@ func (h *testStreamHandler) handleStreamPingPong(t *testing.T, s *Stream) {
} }
} }
// handleStreamSuspension blocks until s.ctx is canceled.
func (h *testStreamHandler) handleStreamSuspension(s *Stream) {
go func() {
<-s.ctx.Done()
}()
}
func (h *testStreamHandler) handleStreamMisbehave(t *testing.T, s *Stream) { func (h *testStreamHandler) handleStreamMisbehave(t *testing.T, s *Stream) {
conn, ok := s.ServerTransport().(*http2Server) conn, ok := s.ServerTransport().(*http2Server)
if !ok { if !ok {
@ -260,7 +253,7 @@ func (s *server) start(t *testing.T, port int, serverConfig *ServerConfig, ht hT
h := &testStreamHandler{transport.(*http2Server)} h := &testStreamHandler{transport.(*http2Server)}
switch ht { switch ht {
case suspended: case suspended:
go transport.HandleStreams(h.handleStreamSuspension, go transport.HandleStreams(func(*Stream) {}, // Do nothing to handle the stream.
func(ctx context.Context, method string) context.Context { func(ctx context.Context, method string) context.Context {
return ctx return ctx
}) })