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

Method WriteRSTStream

internal/http2/frame.go:1264–1271  ·  view source on GitHub ↗

WriteRSTStream writes a RST_STREAM frame. It will perform exactly one Write to the underlying Writer. It is the caller's responsibility to not call other Write methods concurrently.

(streamID uint32, code ErrCode)

Source from the content-addressed store, hash-verified

1262// It will perform exactly one Write to the underlying Writer.
1263// It is the caller's responsibility to not call other Write methods concurrently.
1264func (h2f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error {
1265 if !validStreamID(streamID) && !h2f.AllowIllegalWrites {
1266 return errStreamID
1267 }
1268 h2f.startWrite(FrameRSTStream, 0, streamID)
1269 h2f.writeUint32(uint32(code))
1270 return h2f.endWrite()
1271}
1272
1273// A ContinuationFrame is used to continue a sequence of header block fragments.
1274// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.10

Callers 1

writeStreamResetMethod · 0.80

Calls 4

startWriteMethod · 0.95
writeUint32Method · 0.95
endWriteMethod · 0.95
validStreamIDFunction · 0.85

Tested by

no test coverage detected