Remove Head field from ExtPacket structure. (#662)
* Remove `Head` field from `ExtPacket` structure. Although we do not intend to, but if packets get out-of-order in the forwarding path (maybe reading in multiple goroutines or using some worker pool to distribute packets), the `Head` indicator could lead to wrong behaviour. It is possible that at the receiver, the order is - Seq Num N, Head = true - N + 1, Head = true If the forwarding path sees `N + 1` first, the Head flag when it sees `N` packet is incorrect and will lead to incorrect behaviour. The alternative check is very simple. So, remove `Head` flag. * Remove unused field
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
type TestExtPacketParams struct {
|
||||
SetMarker bool
|
||||
IsHead bool
|
||||
IsKeyFrame bool
|
||||
PayloadType uint8
|
||||
SequenceNumber uint16
|
||||
@@ -45,7 +44,6 @@ func GetTestExtPacket(params *TestExtPacketParams) (*buffer.ExtPacket, error) {
|
||||
}
|
||||
|
||||
ep := &buffer.ExtPacket{
|
||||
Head: params.IsHead,
|
||||
Arrival: params.ArrivalTime,
|
||||
Packet: &packet,
|
||||
KeyFrame: params.IsKeyFrame,
|
||||
|
||||
Reference in New Issue
Block a user