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

Function newStream

internal/http3/stream.go:55–74  ·  view source on GitHub ↗
(
	str datagramStream,
	conn *Conn,
	trace *httptrace.ClientTrace,
	parseTrailer func(io.Reader, *headersFrame) error,
	qlogger qlogwriter.Recorder,
)

Source from the content-addressed store, hash-verified

53}
54
55func newStream(
56 str datagramStream,
57 conn *Conn,
58 trace *httptrace.ClientTrace,
59 parseTrailer func(io.Reader, *headersFrame) error,
60 qlogger qlogwriter.Recorder,
61) *Stream {
62 return &Stream{
63 datagramStream: str,
64 conn: conn,
65 buf: make([]byte, 16),
66 qlogger: qlogger,
67 parseTrailer: parseTrailer,
68 frameParser: &frameParser{
69 r: &tracingReader{Reader: str, trace: trace},
70 streamID: str.StreamID(),
71 closeConn: conn.CloseWithError,
72 },
73 }
74}
75
76func (s *Stream) Read(b []byte) (int, error) {
77 if s.bytesRemainingInFrame == 0 {

Callers 1

openRequestStreamMethod · 0.85

Calls 1

StreamIDMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…