internal/transport: remove unnecessary ServerTransport method (#2224)

This commit is contained in:
dfawley
2018-07-17 08:26:04 -07:00
committed by GitHub
parent a7d6032db4
commit b534d2d20e
2 changed files with 3 additions and 10 deletions

View File

@ -307,12 +307,6 @@ func (s *Stream) Trailer() metadata.MD {
return c
}
// ServerTransport returns the underlying ServerTransport for the stream.
// The client side stream always returns nil.
func (s *Stream) ServerTransport() ServerTransport {
return s.st
}
// ContentSubtype returns the content-subtype for a request. For example, a
// content-subtype of "proto" will result in a content-type of
// "application/grpc+proto". This will always be lowercase. See
@ -359,8 +353,7 @@ func (s *Stream) SetHeader(md metadata.MD) error {
// combined with any metadata set by previous calls to SetHeader and
// then written to the transport stream.
func (s *Stream) SendHeader(md metadata.MD) error {
t := s.ServerTransport()
return t.WriteHeader(s, md)
return s.st.WriteHeader(s, md)
}
// SetTrailer sets the trailer metadata which will be sent with the RPC status

View File

@ -140,9 +140,9 @@ func (h *testStreamHandler) handleStreamPingPong(t *testing.T, s *Stream) {
}
func (h *testStreamHandler) handleStreamMisbehave(t *testing.T, s *Stream) {
conn, ok := s.ServerTransport().(*http2Server)
conn, ok := s.st.(*http2Server)
if !ok {
t.Fatalf("Failed to convert %v to *http2Server", s.ServerTransport())
t.Fatalf("Failed to convert %v to *http2Server", s.st)
}
var sent int
p := make([]byte, http2MaxFrameLen)