use session.cancel in the router to make blocking safe, reduce size of fromRouter buffer so the drops in the switch are closer to the intended front-drop behavior

This commit is contained in:
Arceliar 2019-08-04 02:21:41 -05:00
parent 7bf5884ac1
commit 1e6a6d2160
2 changed files with 3 additions and 3 deletions

View file

@ -166,8 +166,8 @@ func (r *router) handleTraffic(packet []byte) {
return
}
select {
case sinfo.fromRouter <- &p: // FIXME ideally this should be front drop
default:
case sinfo.fromRouter <- &p:
case <-sinfo.cancel.Finished():
util.PutBytes(p.Payload)
}
}