Look the expected checksum up instead of carrying it in the frame

This commit is contained in:
flamingcow
2026-08-04 12:45:04 -07:00
parent 03b7ff4954
commit 1f9b5ea62e
4 changed files with 18 additions and 12 deletions
+3 -2
View File
@@ -61,12 +61,13 @@ func (w *rxWorker) run(done *atomic.Bool) {
w.streams[p.stream].observe(p.seq)
}
if p.payLen > w.spec.maxPay {
want, ok := w.spec.expectedCRC(p.patIdx, p.payLen)
if !ok {
w.stats.badLen.Add(1)
continue
}
pay := buf[minFrame : minFrame+p.payLen]
if crc32.Checksum(pay, crcTable) != p.crc {
if crc32.Checksum(pay, crcTable) != want {
w.stats.crcErr.Add(1)
}
}