Look the expected checksum up instead of carrying it in the frame
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user