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

Method endWrite

internal/http2/frame.go:361–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

359}
360
361func (h2f *Framer) endWrite() error {
362 // Now that we know the final size, fill in the FrameHeader in
363 // the space previously reserved for it. Abuse append.
364 length := len(h2f.wbuf) - frameHeaderLen
365 if length >= (1 << 24) {
366 return errFrameTooLarge
367 }
368 _ = append(h2f.wbuf[:0],
369 byte(length>>16),
370 byte(length>>8),
371 byte(length))
372 if h2f.logWrites {
373 h2f.logWrite()
374 }
375
376 n, err := h2f.w.Write(h2f.wbuf)
377 if err == nil && n != len(h2f.wbuf) {
378 err = io.ErrShortWrite
379 }
380 return err
381}
382
383func (h2f *Framer) logWrite() {
384 if h2f.debugFramer == nil {

Callers 12

WriteDataPaddedMethod · 0.95
WriteSettingsMethod · 0.95
WriteSettingsAckMethod · 0.95
WritePingMethod · 0.95
WriteGoAwayMethod · 0.95
WriteWindowUpdateMethod · 0.95
WriteHeadersMethod · 0.95
WritePriorityMethod · 0.95
WriteRSTStreamMethod · 0.95
WriteContinuationMethod · 0.95
WritePushPromiseMethod · 0.95
WriteRawFrameMethod · 0.95

Calls 2

logWriteMethod · 0.95
WriteMethod · 0.65

Tested by

no test coverage detected