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)
| 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. |
| 1224 | func (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 |
no test coverage detected