MCPcopy
hub / github.com/grpc/grpc-go / recv

Function recv

rpc_util.go:1053–1068  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1051// dc takes precedence over compressor.
1052// TODO(dfawley): wrap the old compressor/decompressor using the new API?
1053func 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
1071type rpcInfo struct {

Callers 3

recvMsgMethod · 0.85
RecvMsgMethod · 0.85
RecvMsgMethod · 0.85

Calls 4

ErrorfFunction · 0.92
recvAndDecompressFunction · 0.85
FreeMethod · 0.65
UnmarshalMethod · 0.65

Tested by

no test coverage detected