Skip to content

Commit

Permalink
added an error handling to FEC encode(though it may not be called)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Sep 11, 2024
1 parent 50402da commit 2ffcdaf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fec.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ func (enc *fecEncoder) encode(b []byte, rto uint32) (ps [][]byte) {
enc.markParity(ps[k][enc.headerOffset:])
ps[k] = ps[k][:enc.maxSize]
}
} else {
// record the error, and still keep the seqid monotonic increasing
atomic.AddUint64(&DefaultSnmp.FECErrs, 1)
enc.next = (enc.next + uint32(enc.parityShards)) % enc.paws
}
} else {
// through we do not send non-continuous parity shard, we still increase the next value
Expand Down

0 comments on commit 2ffcdaf

Please sign in to comment.