Close the transport if NewSession fails

The makes sure we always send the `</stream:stream>` or `<close/>` correctly.
disco_info_form
Wichert Akkerman 5 years ago committed by Mickaël Rémond
parent a6709a1f71
commit 60e2cdd088

@ -173,6 +173,7 @@ func (c *Client) Resume(state SMState) error {
// Client is ok, we now open XMPP session
if c.Session, err = NewSession(c.transport, c.config, state); err != nil {
c.transport.Close()
return err
}
c.Session.StreamId = streamId

Loading…
Cancel
Save