Skip to content

Commit

Permalink
http2: support ResponseController.EnableFullDuplex
Browse files Browse the repository at this point in the history
The ResponseController.EnableFullDuplex method indicates that an HTTP
handler intends to interleave reads from a request body with writes
to the response body.

Add an EnableFullDuplex method to the ResponseWriter so we don't
return a not-supported error. The HTTP/2 server always supports
full duplex, so this is a no-op.

For golang/go#57786

Change-Id: I6529e6ce01d59b8b48fb67ba7c244255df57c174
Reviewed-on: https://go-review.googlesource.com/c/net/+/472717
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Дарья Бочкар <dasha7vanya@gmail.com>
  • Loading branch information
neild committed Oct 10, 2024
1 parent 6cc5ac4 commit 42b1186
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,11 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
return nil
}

func (w *responseWriter) EnableFullDuplex() error {
// We always support full duplex responses, so this is a no-op.
return nil
}

func (w *responseWriter) Flush() {
w.FlushError()
}
Expand Down

0 comments on commit 42b1186

Please sign in to comment.