From ea781e569b28fa4e5e50131cc11c8a376bd01a86 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 2 Sep 2020 09:46:31 -0700 Subject: [PATCH] bug fix: propogate error when connecting --- src/croc/croc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 459c90ec..51979a0a 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -517,7 +517,8 @@ func (c *Client) Receive() (err error) { if address == "" { continue } - host, port, err := net.SplitHostPort(address) + var host, port string + host, port, err = net.SplitHostPort(address) if err != nil { log.Errorf("bad relay address %s", address) continue @@ -536,14 +537,13 @@ func (c *Client) Receive() (err error) { } log.Debugf("could not establish '%s'", address) } - - log.Debugf("banner: %s", banner) if err != nil { err = fmt.Errorf("could not connect to %s: %w", c.Options.RelayAddress, err) log.Debug(err) return } log.Debugf("receiver connection established: %+v", c.conn[0]) + log.Debugf("banner: %s", banner) if !usingLocal && !c.Options.DisableLocal { // ask the sender for their local ips and port