5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-10 07:30:27 +00:00

stop synchronizing message reads for now, not 100% safe but I don't have any better ideas

This commit is contained in:
Arceliar 2019-08-24 16:13:34 -05:00
parent 209d2ffea5
commit 99be6b037d

View File

@ -392,7 +392,10 @@ func (intf *linkInterface) handler() error {
msg, err := intf.msgIO.readMsg() msg, err := intf.msgIO.readMsg()
if len(msg) > 0 { if len(msg) > 0 {
// TODO rewrite this if the link becomes an actor // TODO rewrite this if the link becomes an actor
<-intf.peer.SyncExec(func() { intf.peer._handlePacket(msg) }) // FIXME this could theoretically send traffic faster than the peer can handle
// The alternative is to SyncExec, but that causes traffic to block while *other* links work
// Need to figure out why and find a workaround
intf.peer.handlePacketFrom(nil, msg)
} }
if err != nil { if err != nil {
if err != io.EOF { if err != io.EOF {