forked from quic-go/quic-go
http3: convert Stream from an interface to a struct (#5154)
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
// The HTTPStreamer allows taking over a HTTP/3 stream. The interface is implemented by the http.ResponseWriter.
|
||||
// When a stream is taken over, it's the caller's responsibility to close the stream.
|
||||
type HTTPStreamer interface {
|
||||
HTTPStream() Stream
|
||||
HTTPStream() *Stream
|
||||
}
|
||||
|
||||
// The maximum length of an encoded HTTP/3 frame header is 16:
|
||||
@@ -27,7 +27,7 @@ const frameHeaderLen = 16
|
||||
const maxSmallResponseSize = 4096
|
||||
|
||||
type responseWriter struct {
|
||||
str *stream
|
||||
str *Stream
|
||||
|
||||
conn Connection
|
||||
header http.Header
|
||||
@@ -65,7 +65,7 @@ var (
|
||||
} = &responseWriter{}
|
||||
)
|
||||
|
||||
func newResponseWriter(str *stream, conn Connection, isHead bool, logger *slog.Logger) *responseWriter {
|
||||
func newResponseWriter(str *Stream, conn Connection, isHead bool, logger *slog.Logger) *responseWriter {
|
||||
return &responseWriter{
|
||||
str: str,
|
||||
conn: conn,
|
||||
@@ -331,7 +331,7 @@ func (w *responseWriter) writeTrailers() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (w *responseWriter) HTTPStream() Stream {
|
||||
func (w *responseWriter) HTTPStream() *Stream {
|
||||
w.hijacked = true
|
||||
w.Flush()
|
||||
return w.str
|
||||
|
||||
Reference in New Issue
Block a user