Skip to content

Commit

Permalink
fix: updated reader headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenrinzema committed Aug 24, 2024
1 parent f7957a3 commit 3465ec7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/buffer/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3465ec7

Please sign in to comment.