From 3465ec78baa6579b0350f75c7bcdfd7a7a747d32 Mon Sep 17 00:00:00 2001 From: Jeroen Rinzema Date: Sat, 24 Aug 2024 16:21:47 +0200 Subject: [PATCH] fix: updated reader headers --- pkg/buffer/reader.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/buffer/reader.go b/pkg/buffer/reader.go index 2444789..406cfca 100644 --- a/pkg/buffer/reader.go +++ b/pkg/buffer/reader.go @@ -54,7 +54,6 @@ func NewReader(logger *slog.Logger, reader io.Reader, bufferSize int) *Reader { func (reader *Reader) reset(size int) { if reader.Msg != nil { reader.Msg = reader.Msg[len(reader.Msg):] - return } if cap(reader.Msg) >= size { @@ -153,7 +152,7 @@ func (reader *Reader) ReadUntypedMsg() (int, error) { reader.reset(size) n, err := io.ReadFull(reader.Buffer, reader.Msg) - return n, err + return len(reader.header) + n, err } // GetString reads a null-terminated string.