TUN-2178: public API to create new h2mux.MuxedStreamRequest

This commit is contained in:
Nick Vollmar
2019-11-13 14:04:19 -06:00
parent c5af83af66
commit 1d96bccc04
2 changed files with 9 additions and 2 deletions

View File

@@ -54,6 +54,13 @@ type MuxedStreamRequest struct {
body io.Reader
}
func NewMuxedStreamRequest(stream *MuxedStream, body io.Reader) MuxedStreamRequest {
return MuxedStreamRequest{
stream: stream,
body: body,
}
}
func (r *MuxedStreamRequest) flushBody() {
io.Copy(r.stream, r.body)
r.stream.CloseWrite()