Skip to content

Commit

Permalink
with *[]byte interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tspiridonova committed Mar 18, 2021
1 parent 2a92354 commit 964f1a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rpc_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,12 @@ func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m interf
if err != nil {
return err
}
if _, ok := m.(*io.PipeWriter); ok {
defer func() {
m.(*io.PipeWriter).Close()
}()
_, err = m.(*io.PipeWriter).Write(d)
return err
if _, ok := m.(*[]byte); ok {
*m.(*[]byte) = d
if payInfo != nil {
payInfo.uncompressedBytes = d
}
return nil
}
if err = c.Unmarshal(d, m); err != nil {
return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message %v", err)
Expand Down

0 comments on commit 964f1a9

Please sign in to comment.