1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-16 04:04:56 +02:00

conn: delete from pending on close

This commit is contained in:
Anshul 2024-12-03 10:47:00 +05:30
parent 534fd43609
commit ccd64f0b4d
No known key found for this signature in database
GPG key ID: 38215E31C33A5967

View file

@ -173,8 +173,9 @@ func (c *Conn) close(cause error) error {
return ErrClosed
}
for _, call := range c.pending {
for id, call := range c.pending {
close(call.done)
delete(c.pending, id)
}
if cause != nil && cause != io.EOF && cause != io.ErrUnexpectedEOF {