1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
diff --git a/conn.go b/conn.go
index cfd7d3f519b7aa743fe0d63f418588e3d307ab29..bbd76edbe19bc81b821fe25c1430be2eb1949ea6 100644
--- a/conn.go
+++ b/conn.go
@@ -94,20 +94,12 @@ func (c *Conn) Close(ctx context.Context) error {
c.cancel()
defer c.c.Close()
- origCtx := c.ctx
- defer func() { c.ctx = origCtx }()
- c.ctx = ctx
-
- resp, err := c.CmdNoBody(ctx, "QUIT")
+ _, err := c.c.Cmd("QUIT")
if err != nil {
return fmt.Errorf("failed to send QUIT to server: %w", err)
}
- switch resp.Status.Code {
- case StatusConnectionClosing:
- return nil
- default:
- return ErrUnexpectedResponse
- }
+
+ return nil
}
// Cmd runs a command on the given connection and does not parse headers
|