mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-16 04:04:56 +02:00
make call.done channel buffered so it can discard its value if the call got cancelled
This commit is contained in:
parent
7e53931322
commit
9fdd802ab4
1 changed files with 1 additions and 1 deletions
|
|
@ -318,7 +318,7 @@ func (c *Conn) send(ctx context.Context, m *anyMessage, wait bool) (*call, error
|
|||
// responses.
|
||||
var cc *call
|
||||
if m.request != nil && wait {
|
||||
cc = &call{request: m.request, seq: c.seq, done: make(chan error)}
|
||||
cc = &call{request: m.request, seq: c.seq, done: make(chan error, 1)}
|
||||
c.pending[ID{Num: c.seq}] = cc // use next seq as call ID
|
||||
m.request.ID.Num = c.seq
|
||||
c.seq++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue