Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ca0af15

Browse files
committedJan 23, 2025·
Fix buf size in error message
1 parent 67bee55 commit ca0af15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎rpc_util.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,9 @@ func encode(c baseCodec, msg any) (mem.BufferSlice, error) {
692692
if err != nil {
693693
return nil, status.Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error())
694694
}
695-
if uint(b.Len()) > math.MaxUint32 {
695+
if bufSize := uint(b.Len()); bufSize > math.MaxUint32 {
696696
b.Free()
697-
return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", len(b))
697+
return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", bufSize)
698698
}
699699
return b, nil
700700
}

0 commit comments

Comments
 (0)
Please sign in to comment.