Remove buf copy when the compressor exist (#1427)
This commit is contained in:
@ -104,12 +104,12 @@ func (h *testStreamHandler) handleStream(t *testing.T, s *transport.Stream) {
|
||||
}
|
||||
}
|
||||
// send a response back to end the stream.
|
||||
reply, err := encode(testCodec{}, &expectedResponse, nil, nil, nil)
|
||||
hdr, data, err := encode(testCodec{}, &expectedResponse, nil, nil, nil)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to encode the response: %v", err)
|
||||
return
|
||||
}
|
||||
h.t.Write(s, reply, &transport.Options{})
|
||||
h.t.Write(s, hdr, data, &transport.Options{})
|
||||
h.t.WriteStatus(s, status.New(codes.OK, ""))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user