mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 03:47:18 +00:00
Merge pull request #3535 from nspcc-dev/fix/possible-WS-deadlock-on-connection-loss
This commit is contained in:
commit
c2a1c4af53
1 changed files with 7 additions and 1 deletions
|
@ -601,7 +601,13 @@ readloop:
|
|||
connCloseErr = fmt.Errorf("unknown response channel for response %d", id)
|
||||
break readloop // Unknown response (unexpected response ID).
|
||||
}
|
||||
ch <- &rr.Response
|
||||
select {
|
||||
case <-c.writerDone:
|
||||
break readloop
|
||||
case <-c.shutdown:
|
||||
break readloop
|
||||
case ch <- &rr.Response:
|
||||
}
|
||||
} else {
|
||||
// Malformed response, neither valid request, nor valid response.
|
||||
connCloseErr = fmt.Errorf("malformed response")
|
||||
|
|
Loading…
Reference in a new issue