rpcclient: Fix ws-reader hang on sending a response #1

Merged
fyrchik merged 1 commit from aarifullin/neoneo-go:fix/wsreader_hang into support/v0.106-mtls 2024-07-26 10:59:10 +00:00

View file

@ -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")