Skip to content

Commit 384129a

Browse files
hex0punksparrc
hex0punk
authored andcommitted
prevents a goroutine from being leaked if a timeout occurs when calling forceCloseConnection
1 parent 514fc7b commit 384129a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agent/wsclient/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (cs *ClientServerImpl) SetReadDeadline(t time.Time) error {
265265
}
266266

267267
func (cs *ClientServerImpl) forceCloseConnection() {
268-
closeChan := make(chan error)
268+
closeChan := make(chan error, 1)
269269
go func() {
270270
closeChan <- cs.Close()
271271
}()

0 commit comments

Comments
 (0)