Improve packet loss on old TUTK proto

This commit is contained in:
Alex X
2026-01-20 14:19:18 +03:00
parent 7793a55853
commit 75bd1f1b2b
2 changed files with 16 additions and 13 deletions
+3 -3
View File
@@ -171,15 +171,15 @@ func (s *Session25) handleChunk(cmd []byte, checkSeq bool) int {
// "0x20 chunk seq for first chunk if only one chunk".
if binary.LittleEndian.Uint16(cmd2[6:]) == 0 || binary.LittleEndian.Uint16(cmd2[4:]) == 1 {
s.waitData = s.waitData[:0]
s.waitSeq = seq
} else if seq != s.waitSeq {
s.waitCSeq = seq
} else if seq != s.waitCSeq {
return msgMediaLost
}
s.waitData = append(s.waitData, cmd2[20:]...)
if flags&0b0001 == 0 {
s.waitSeq++
s.waitCSeq++
return msgMediaChunk
}