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

Method WriteContinuation

internal/http2/frame.go:1301–1312  ·  view source on GitHub ↗

WriteContinuation writes a CONTINUATION 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, endHeaders bool, headerBlockFragment []byte)

Source from the content-addressed store, hash-verified

1299// It will perform exactly one Write to the underlying Writer.
1300// It is the caller's responsibility to not call other Write methods concurrently.
1301func (h2f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error {
1302 if !validStreamID(streamID) && !h2f.AllowIllegalWrites {
1303 return errStreamID
1304 }
1305 var flags Flags
1306 if endHeaders {
1307 flags |= FlagContinuationEndHeaders
1308 }
1309 h2f.startWrite(FrameContinuation, flags, streamID)
1310 h2f.wbuf = append(h2f.wbuf, headerBlockFragment...)
1311 return h2f.endWrite()
1312}
1313
1314// A PushPromiseFrame is used to initiate a server stream.
1315// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.6

Callers 1

writeHeadersMethod · 0.80

Calls 3

startWriteMethod · 0.95
endWriteMethod · 0.95
validStreamIDFunction · 0.85

Tested by

no test coverage detected