Skip to content

Commit 2e3d018

Browse files
authored
Merge pull request #201 from tomponline/tp-disconnect
Allow Disconnect to be used to cancel ongoing Connect call
2 parents f035778 + f911ede commit 2e3d018

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qmp/socket.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ func (mon *SocketMonitor) Disconnect() error {
104104
atomic.StoreInt32(mon.listeners, 0)
105105
err := mon.c.Close()
106106

107-
for range mon.stream {
107+
if mon.stream != nil {
108+
for range mon.stream {
109+
}
108110
}
109111

110112
return err
@@ -266,7 +268,7 @@ func (mon *SocketMonitor) RunWithFile(command []byte, file *os.File) ([]byte, er
266268
type banner struct {
267269
QMP struct {
268270
Capabilities []string `json:"capabilities"`
269-
Version Version `json:"version"`
271+
Version Version `json:"version"`
270272
} `json:"QMP"`
271273
}
272274

0 commit comments

Comments
 (0)