mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 10:02:00 -08:00
Close the transport if NewSession fails
The makes sure we always send the `</stream:stream>` or `<close/>` correctly.
This commit is contained in:
parent
a6709a1f71
commit
60e2cdd088
@ -173,6 +173,7 @@ func (c *Client) Resume(state SMState) error {
|
|||||||
|
|
||||||
// Client is ok, we now open XMPP session
|
// Client is ok, we now open XMPP session
|
||||||
if c.Session, err = NewSession(c.transport, c.config, state); err != nil {
|
if c.Session, err = NewSession(c.transport, c.config, state); err != nil {
|
||||||
|
c.transport.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.Session.StreamId = streamId
|
c.Session.StreamId = streamId
|
||||||
|
Loading…
Reference in New Issue
Block a user