For the two compressor parameters, both should not be set, but if they are, dc takes precedence over compressor. TODO(dfawley): wrap the old compressor/decompressor using the new API?
(p *parser, c baseCodec, s recvCompressor, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool)
| 1051 | // dc takes precedence over compressor. |
| 1052 | // TODO(dfawley): wrap the old compressor/decompressor using the new API? |
| 1053 | func recv(p *parser, c baseCodec, s recvCompressor, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) error { |
| 1054 | data, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor, isServer) |
| 1055 | if err != nil { |
| 1056 | return err |
| 1057 | } |
| 1058 | |
| 1059 | // If the codec wants its own reference to the data, it can get it. Otherwise, always |
| 1060 | // free the buffers. |
| 1061 | defer data.Free() |
| 1062 | |
| 1063 | if err := c.Unmarshal(data, m); err != nil { |
| 1064 | return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message: %v", err) |
| 1065 | } |
| 1066 | |
| 1067 | return nil |
| 1068 | } |
| 1069 | |
| 1070 | // Information about RPC |
| 1071 | type rpcInfo struct { |