From 46c8bc24de9a1944c693f57d9f95dbaffb396d0f Mon Sep 17 00:00:00 2001 From: Qian Wang Date: Sun, 20 Jan 2019 17:23:45 +0000 Subject: [PATCH] Fix wrapping bug --- internal/multiplex/frameSorter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/multiplex/frameSorter.go b/internal/multiplex/frameSorter.go index cf709fa..ce4bef5 100644 --- a/internal/multiplex/frameSorter.go +++ b/internal/multiplex/frameSorter.go @@ -97,11 +97,11 @@ func (s *Stream) recvNewFrame() { // wrapMode is true when the latest seq is wrapped but nextN is not s.wrapMode = true } - fs.trueSeq = uint64(1<<16*(s.rev+1)) + uint64(f.Seq) + 1 + fs.trueSeq = uint64(1<<32*(s.rev+1)) + uint64(f.Seq) + 1 // +1 because wrapped 0 should have trueSeq of 256 instead of 255 // when this bit was run on 1, the trueSeq of 1 would become 256 } else { - fs.trueSeq = uint64(1<<16*s.rev) + uint64(f.Seq) + fs.trueSeq = uint64(1<<32*s.rev) + uint64(f.Seq) // when this bit was run on 255, the trueSeq of 255 would be 255 }