Skip to content

Commit b27887e

Browse files
committed
fix(fec): prevent permanent blocking in auto-tune when parameters unchanged
Fix shouldTune flag not being reset when auto-detected FEC parameters match current parameters. This could cause the decoder to permanently discard all incoming packets if a corrupted packet triggered shouldTune but the actual FEC configuration hadn't changed. Move `dec.shouldTune = false` outside the parameter-change check to ensure the flag is always reset when valid parameters are detected.
1 parent ca00425 commit b27887e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fec.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ func (dec *fecDecoder) decode(in fecPacket) (recovered [][]byte) {
204204
dec.decodeCache = make([][]byte, dec.shardSize)
205205
dec.flagCache = make([]bool, dec.shardSize)
206206
dec.paws = 0xffffffff / uint32(dec.shardSize) * uint32(dec.shardSize)
207-
dec.shouldTune = false
208207
//log.Println("autotune to :", dec.dataShards, dec.parityShards)
209208
}
209+
// reset shouldTune flag regardless of whether parameters changed
210+
// to avoid permanent blocking when detected parameters match current ones
211+
dec.shouldTune = false
210212
}
211213
return nil
212214
}

0 commit comments

Comments
 (0)