remove the http3.DataStreamer (#3435)

This commit is contained in:
Marten Seemann
2022-06-09 10:17:43 +02:00
committed by GitHub
parent e27fa1c9cf
commit ccf897e519
3 changed files with 4 additions and 73 deletions

View File

@@ -12,25 +12,14 @@ import (
"github.com/marten-seemann/qpack"
)
// DataStreamer lets the caller take over the stream. After a call to DataStream
// the HTTP server library will not do anything else with the connection.
//
// It becomes the caller's responsibility to manage and close the stream.
//
// After a call to DataStream, the original Request.Body must not be used.
type DataStreamer interface {
DataStream() quic.Stream
}
type responseWriter struct {
conn quic.Connection
stream quic.Stream // needed for DataStream()
bufferedStream *bufio.Writer
header http.Header
status int // status code passed to WriteHeader
headerWritten bool
dataStreamUsed bool // set when DataSteam() is called
header http.Header
status int // status code passed to WriteHeader
headerWritten bool
logger utils.Logger
}
@@ -38,7 +27,6 @@ type responseWriter struct {
var (
_ http.ResponseWriter = &responseWriter{}
_ http.Flusher = &responseWriter{}
_ DataStreamer = &responseWriter{}
_ Hijacker = &responseWriter{}
)
@@ -112,16 +100,6 @@ func (w *responseWriter) Flush() {
}
}
func (w *responseWriter) usedDataStream() bool {
return w.dataStreamUsed
}
func (w *responseWriter) DataStream() quic.Stream {
w.dataStreamUsed = true
w.Flush()
return w.stream
}
func (w *responseWriter) StreamID() quic.StreamID {
return w.stream.StreamID()
}