Skip to content

Commit

Permalink
Close stream before closing connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdosch committed Feb 25, 2024
1 parent b7ea9f4 commit 9684a8f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xmpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ func NewClientNoTLS(host, user, passwd string, debug bool) (*Client, error) {
// Close closes the XMPP connection
func (c *Client) Close() error {
if c.conn != (*tls.Conn)(nil) {
fmt.Fprintf(c.stanzaWriter, "</stream:stream>\n")
return c.conn.Close()
}
return nil
Expand Down

0 comments on commit 9684a8f

Please sign in to comment.