(f *RSTStreamFrame)
| 3034 | } |
| 3035 | |
| 3036 | func (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. |
| 3057 | func (cc *ClientConn) Ping(ctx context.Context) error { |
no test coverage detected