mirror of https://bitbucket.org/ausocean/av.git
connect() now closes c.link.conn upon an error.
This commit is contained in:
parent
04ad1fec25
commit
a362d1d2ab
|
@ -174,6 +174,13 @@ func connect(c *Conn) error {
|
|||
return err
|
||||
}
|
||||
c.log(DebugLevel, pkg+"connected")
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
c.link.conn.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
err = handshake(c)
|
||||
if err != nil {
|
||||
c.log(WarnLevel, pkg+"handshake failed", "error", err.Error())
|
||||
|
|
Loading…
Reference in New Issue