cleanup new message creation

This commit is contained in:
Asim Aslam
2019-09-04 12:16:31 +01:00
parent c718b8bf93
commit d5be2136ad
3 changed files with 32 additions and 63 deletions

View File

@@ -830,15 +830,13 @@ func (t *tun) Dial(channel string, opts ...DialOption) (Session, error) {
// shit fuck
if !c.discovered {
t.send <- &message{
typ: "discover",
tunnel: t.id,
channel: channel,
session: c.session,
broadcast: true,
outbound: true,
errChan: c.errChan,
}
msg := c.newMessage("discover")
msg.broadcast = true
msg.outbound = true
msg.link = ""
// send the discovery message
t.send <- msg
select {
case err := <-c.errChan: