client: Notify session when explicitly disconnected
Run tests / test (push) Has been cancelled

This commit is contained in:
Matthew Wild
2025-10-09 10:24:07 +01:00
committed by Mickaël Rémond
parent 240e7f5bff
commit bc2b7ceee4
+5 -1
View File
@@ -296,7 +296,11 @@ func (c *Client) Resume() error {
// Disconnect disconnects the client from the server, sending a stream close nonza and closing the TCP connection.
func (c *Client) Disconnect() error {
if c.transport != nil {
return c.transport.Close()
err := c.transport.Close()
if c.Session != nil {
c.disconnected(c.Session.SMState)
}
return err
}
// No transport so no connection.
return nil