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

Function checkRecvPayload

rpc_util.go:908–925  ·  view source on GitHub ↗
(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool)

Source from the content-addressed store, hash-verified

906}
907
908func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool) *status.Status {
909 switch pf {
910 case compressionNone:
911 case compressionMade:
912 if recvCompress == "" || recvCompress == encoding.Identity {
913 return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding")
914 }
915 if !haveCompressor {
916 if isServer {
917 return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress)
918 }
919 return status.Newf(codes.Internal, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress)
920 }
921 default:
922 return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf)
923 }
924 return nil
925}
926
927type payloadInfo struct {
928 compressedLength int // The compressed length got from wire.

Callers 1

recvAndDecompressFunction · 0.85

Calls 2

NewFunction · 0.92
NewfFunction · 0.92

Tested by

no test coverage detected