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

Method WritePriority

internal/http2/frame.go:1224–1239  ·  view source on GitHub ↗

WritePriority writes a PRIORITY 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, p http2.PriorityParam)

Source from the content-addressed store, hash-verified

1222// It will perform exactly one Write to the underlying Writer.
1223// It is the caller's responsibility to not call other Write methods concurrently.
1224func (h2f *Framer) WritePriority(streamID uint32, p http2.PriorityParam) error {
1225 if !validStreamID(streamID) && !h2f.AllowIllegalWrites {
1226 return errStreamID
1227 }
1228 if !validStreamIDOrZero(p.StreamDep) {
1229 return errDepStreamID
1230 }
1231 h2f.startWrite(FramePriority, 0, streamID)
1232 v := p.StreamDep
1233 if p.Exclusive {
1234 v |= 1 << 31
1235 }
1236 h2f.writeUint32(v)
1237 h2f.writeByte(p.Weight)
1238 return h2f.endWrite()
1239}
1240
1241// A RSTStreamFrame allows for abnormal termination of a stream.
1242// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.4

Callers 1

newClientConnMethod · 0.80

Calls 6

startWriteMethod · 0.95
writeUint32Method · 0.95
writeByteMethod · 0.95
endWriteMethod · 0.95
validStreamIDFunction · 0.85
validStreamIDOrZeroFunction · 0.85

Tested by

no test coverage detected