From b051a67ce2e3e8d93dcd0ae2c4ab641db21ba19a Mon Sep 17 00:00:00 2001 From: hezhiwen Date: Sat, 11 Nov 2023 16:37:06 +0800 Subject: [PATCH] Fix encode buf len --- internal/remote/codec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/remote/codec.go b/internal/remote/codec.go index 6b3d3d60..b3948dc7 100644 --- a/internal/remote/codec.go +++ b/internal/remote/codec.go @@ -188,7 +188,7 @@ func encode(command *RemotingCommand) ([]byte, error) { } frameSize := 4 + len(header) + len(command.Body) - buf := bytes.NewBuffer(make([]byte, frameSize)) + buf := bytes.NewBuffer(make([]byte, frameSize+4)) buf.Reset() err = binary.Write(buf, binary.BigEndian, int32(frameSize))