Close net.Conn in conn.Close

Close the connection in conn.Close. This ensures the connection isn't
still alive after conn.Close, which would cause issues when
disconnecting and reconnecting quickly to an upstream server.
This commit is contained in:
Simon Ser 2020-06-04 12:18:51 +02:00
parent cb99e97f5f
commit bee2001e29
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -84,9 +84,10 @@ func (c *conn) Close() error {
return fmt.Errorf("connection already closed") return fmt.Errorf("connection already closed")
} }
err := c.net.Close()
c.closed = true c.closed = true
close(c.outgoing) close(c.outgoing)
return nil return err
} }
func (c *conn) ReadMessage() (*irc.Message, error) { func (c *conn) ReadMessage() (*irc.Message, error) {