mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 10:41:40 +00:00
possible fix if monotonic time resolution is related to packet reordering
This commit is contained in:
parent
3e07995518
commit
98339cdc3f
@ -808,12 +808,12 @@ func (t *switchTable) _handleIdle(port switchPort) bool {
|
|||||||
packet := buf.packets[0]
|
packet := buf.packets[0]
|
||||||
coords := switch_getPacketCoords(packet.bytes)
|
coords := switch_getPacketCoords(packet.bytes)
|
||||||
priority := float64(now.Sub(packet.time)) / float64(buf.size)
|
priority := float64(now.Sub(packet.time)) / float64(buf.size)
|
||||||
if priority > bestPriority && t.portIsCloser(coords, port) {
|
if priority >= bestPriority && t.portIsCloser(coords, port) {
|
||||||
best = streamID
|
best = streamID
|
||||||
bestPriority = priority
|
bestPriority = priority
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if bestPriority != 0 {
|
if best != "" {
|
||||||
buf := t.queues.bufs[best]
|
buf := t.queues.bufs[best]
|
||||||
var packet switch_packetInfo
|
var packet switch_packetInfo
|
||||||
// TODO decide if this should be LIFO or FIFO
|
// TODO decide if this should be LIFO or FIFO
|
||||||
|
Loading…
Reference in New Issue
Block a user