forked from quic-go/quic-go
http3: convert Stream from an interface to a struct (#5154)
This commit is contained in:
@@ -19,14 +19,14 @@ var errTooMuchData = errors.New("peer sent too much data")
|
||||
|
||||
// The body is used in the requestBody (for a http.Request) and the responseBody (for a http.Response).
|
||||
type body struct {
|
||||
str *stream
|
||||
str *Stream
|
||||
|
||||
remainingContentLength int64
|
||||
violatedContentLength bool
|
||||
hasContentLength bool
|
||||
}
|
||||
|
||||
func newBody(str *stream, contentLength int64) *body {
|
||||
func newBody(str *Stream, contentLength int64) *body {
|
||||
b := &body{str: str}
|
||||
if contentLength >= 0 {
|
||||
b.hasContentLength = true
|
||||
@@ -81,7 +81,7 @@ type requestBody struct {
|
||||
|
||||
var _ io.ReadCloser = &requestBody{}
|
||||
|
||||
func newRequestBody(str *stream, contentLength int64, connCtx context.Context, rcvdSettings <-chan struct{}, getSettings func() *Settings) *requestBody {
|
||||
func newRequestBody(str *Stream, contentLength int64, connCtx context.Context, rcvdSettings <-chan struct{}, getSettings func() *Settings) *requestBody {
|
||||
return &requestBody{
|
||||
body: *newBody(str, contentLength),
|
||||
connCtx: connCtx,
|
||||
@@ -102,7 +102,7 @@ type hijackableBody struct {
|
||||
|
||||
var _ io.ReadCloser = &hijackableBody{}
|
||||
|
||||
func newResponseBody(str *stream, contentLength int64, done chan<- struct{}) *hijackableBody {
|
||||
func newResponseBody(str *Stream, contentLength int64, done chan<- struct{}) *hijackableBody {
|
||||
return &hijackableBody{
|
||||
body: *newBody(str, contentLength),
|
||||
reqDone: done,
|
||||
|
||||
Reference in New Issue
Block a user