You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err)
773
+
returnnil, nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err)
772
774
}
773
775
ifsize>maxReceiveMessageSize {
774
776
// TODO: Revisit the error code. Currently keep it consistent with java
775
777
// implementation.
776
-
returnnil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize)
778
+
returnnil, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize)
777
779
}
780
+
} else {
781
+
uncompressedBuf=compressedBuf
778
782
}
779
-
returnbuf, nil
783
+
784
+
ifpayInfo!=nil {
785
+
payInfo.compressedLength=len(compressedBuf)
786
+
payInfo.uncompressedBytes=uncompressedBuf
787
+
788
+
cancel=func() {}
789
+
} else {
790
+
cancel=func() {
791
+
p.recvBufferPool.Put(&compressedBuf)
792
+
}
793
+
}
794
+
795
+
returnuncompressedBuf, cancel, nil
780
796
}
781
797
782
798
// Using compressor, decompress d, returning data and size.
@@ -796,6 +812,9 @@ func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize
796
812
// size is used as an estimate to size the buffer, but we
797
813
// will read more data if available.
798
814
// +MinRead so ReadFrom will not reallocate if size is correct.
815
+
//
816
+
// TODO: If we ensure that the buffer size is the same as the DecompressedSize,
0 commit comments