(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool)
| 906 | } |
| 907 | |
| 908 | func 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 | |
| 927 | type payloadInfo struct { |
| 928 | compressedLength int // The compressed length got from wire. |
no test coverage detected