mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 12:59:57 +00:00
TUN-2651: Fix panic in h2mux reader when a stream error is encountered
This commit is contained in:
@@ -97,7 +97,12 @@ func (r *MuxReader) run(parentLogger *log.Entry) error {
|
|||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case http2.StreamError:
|
case http2.StreamError:
|
||||||
errLogger.Warn("stream error")
|
errLogger.Warn("stream error")
|
||||||
r.streamError(e.StreamID, e.Code)
|
// Ideally we wouldn't return here, since that aborts the muxer.
|
||||||
|
// We should communicate the error to the relevant MuxedStream
|
||||||
|
// data structure, so that callers of MuxedStream.Read() and
|
||||||
|
// MuxedStream.Write() would see it. Then we could `continue`
|
||||||
|
// and keep the muxer going.
|
||||||
|
return r.streamError(e.StreamID, e.Code)
|
||||||
case http2.ConnectionError:
|
case http2.ConnectionError:
|
||||||
errLogger.Warn("connection error")
|
errLogger.Warn("connection error")
|
||||||
return r.connectionError(err)
|
return r.connectionError(err)
|
||||||
|
Reference in New Issue
Block a user