mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
re-enable session workers in a way that doesn't block and drops packets before decrypting if necessary
This commit is contained in:
parent
06df791efc
commit
304f22dc1d
2 changed files with 24 additions and 15 deletions
|
@ -66,7 +66,7 @@ func (r *router) init(core *Core) {
|
|||
r.reconfigure = make(chan chan error, 1)
|
||||
r.addr = *address.AddrForNodeID(&r.core.dht.nodeID)
|
||||
r.subnet = *address.SubnetForNodeID(&r.core.dht.nodeID)
|
||||
in := make(chan []byte, 32) // TODO something better than this...
|
||||
in := make(chan []byte, 1) // TODO something better than this...
|
||||
p := r.core.peers.newPeer(&r.core.boxPub, &r.core.sigPub, &crypto.BoxSharedKey{}, "(self)", nil)
|
||||
p.out = func(packet []byte) { in <- packet }
|
||||
r.in = in
|
||||
|
@ -322,9 +322,6 @@ func (r *router) sendPacket(bs []byte) {
|
|||
// Don't continue - drop the packet
|
||||
return
|
||||
}
|
||||
|
||||
sinfo.doSend(bs)
|
||||
return
|
||||
sinfo.send <- bs
|
||||
}
|
||||
}
|
||||
|
@ -404,8 +401,6 @@ func (r *router) handleTraffic(packet []byte) {
|
|||
if !isIn {
|
||||
return
|
||||
}
|
||||
sinfo.doRecv(&p)
|
||||
return
|
||||
sinfo.recv <- &p
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue