have createSession fill the sessionInfo.cancel field, have Conn use Conn.session.cancel instead of storing its own cancellation, this should prevent any of these things from being both nil and reachable at the same time

This commit is contained in:
Arceliar 2019-08-05 19:11:28 -05:00
parent 8a85149817
commit 679866d5ff
4 changed files with 15 additions and 14 deletions

View file

@ -69,7 +69,7 @@ func (d *Dialer) DialByNodeIDandMask(nodeID, nodeMask *crypto.NodeID) (*Conn, er
defer t.Stop()
select {
case <-conn.session.init:
conn.session.startWorkers(conn.cancel)
conn.session.startWorkers()
return conn, nil
case <-t.C:
conn.Close()