From 5d7bf53f78859cabd867fcf96b6e3722aed70fc6 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 25 Oct 2019 15:41:37 +0100 Subject: [PATCH] don't error where the connection is not unicast --- tunnel/session.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tunnel/session.go b/tunnel/session.go index 1dfe992c..0fcab963 100644 --- a/tunnel/session.go +++ b/tunnel/session.go @@ -110,7 +110,7 @@ func (s *session) newMessage(typ string) *message { func (s *session) waitFor(msgType string, timeout time.Duration) (*message, error) { now := time.Now() - after := func() time.Duration { + after := func(timeout time.Duration) time.Duration { d := time.Since(now) // dial timeout minus time since wait := timeout - d @@ -133,7 +133,7 @@ func (s *session) waitFor(msgType string, timeout time.Duration) (*message, erro } // got the message return msg, nil - case <-time.After(after()): + case <-time.After(after(timeout)): return nil, ErrDialTimeout case <-s.closed: return nil, io.EOF @@ -188,9 +188,6 @@ func (s *session) Discover() error { // wait for announce _, err = s.waitFor("announce", dialTimeout) - if err != nil { - return err - } // if its multicast just go ahead because this is best effort if s.mode != Unicast {