MCPcopy Create free account
hub / github.com/imroc/req / processResetStream

Method processResetStream

internal/http2/transport.go:3036–3054  ·  view source on GitHub ↗
(f *RSTStreamFrame)

Source from the content-addressed store, hash-verified

3034}
3035
3036func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error {
3037 cs := rl.streamByID(f.StreamID)
3038 if cs == nil {
3039 // TODO: return error if server tries to RST_STREAM an idle stream
3040 return nil
3041 }
3042 serr := streamError(cs.ID, f.ErrCode)
3043 serr.Cause = errFromPeer
3044 if f.ErrCode == ErrCodeProtocol {
3045 rl.cc.SetDoNotReuse()
3046 }
3047 if fn := cs.cc.t.CountError; fn != nil {
3048 fn("recv_rststream_" + f.ErrCode.stringToken())
3049 }
3050 cs.abortStream(serr)
3051
3052 cs.bufPipe.CloseWithError(serr)
3053 return nil
3054}
3055
3056// Ping sends a PING frame to the server and waits for the ack.
3057func (cc *ClientConn) Ping(ctx context.Context) error {

Callers 1

runMethod · 0.95

Calls 6

streamByIDMethod · 0.95
streamErrorFunction · 0.85
SetDoNotReuseMethod · 0.80
stringTokenMethod · 0.80
abortStreamMethod · 0.80
CloseWithErrorMethod · 0.45

Tested by

no test coverage detected