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
1 changed files with 1 additions and 0 deletions
|
@ -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…
Reference in a new issue