diff --git a/spop/frame.go b/spop/frame.go index 0587c05..d347c4e 100644 --- a/spop/frame.go +++ b/spop/frame.go @@ -65,7 +65,7 @@ func (f *frame) ReadFrom(r io.Reader) (int64, error) { return int64(n + len(f.length)), io.ErrUnexpectedEOF } - return int64(n + len(f.length)), f.decodeHeader() + return int64(uint32Len + n + len(f.length)), f.decodeHeader() } func (f *frame) WriteTo(w io.Writer) (int64, error) { @@ -76,7 +76,7 @@ func (f *frame) WriteTo(w io.Writer) (int64, error) { } n, err := w.Write(f.buf.ReadBytes()) - return int64(n + len(f.length)), err + return int64(uint32Len + n + len(f.length)), err } func (f *frame) encodeHeader() error {