mirror of https://github.com/grpc/grpc-go.git
http2_client: fix reader segfault on PROTOCOL_ERRORs (#3926)
This commit is contained in:
parent
dad518ae5e
commit
9a3c02f983
|
|
@ -1306,7 +1306,13 @@ func (t *http2Client) reader() {
|
|||
if s != nil {
|
||||
// use error detail to provide better err message
|
||||
code := http2ErrConvTab[se.Code]
|
||||
msg := t.framer.fr.ErrorDetail().Error()
|
||||
errorDetail := t.framer.fr.ErrorDetail()
|
||||
var msg string
|
||||
if errorDetail != nil {
|
||||
msg = errorDetail.Error()
|
||||
} else {
|
||||
msg = "received invalid frame"
|
||||
}
|
||||
t.closeStream(s, status.Error(code, msg), true, http2.ErrCodeProtocol, status.New(code, msg), nil, false)
|
||||
}
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in New Issue