From bc2b7ceee4b4d4c9ba5ec2451afdd43462f0b188 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 9 Oct 2025 10:24:07 +0100 Subject: [PATCH] client: Notify session when explicitly disconnected --- client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 1242dd3..0a29605 100644 --- a/client.go +++ b/client.go @@ -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