From 42b11863606139133313f265e6cf2a4d1d8ca972 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 1 Mar 2023 15:35:42 -0800 Subject: [PATCH] http2: support ResponseController.EnableFullDuplex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Brad Fitzpatrick Reviewed-by: Дарья Бочкар --- http2/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http2/server.go b/http2/server.go index 617b4a476..d6d8ac88b 100644 --- a/http2/server.go +++ b/http2/server.go @@ -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() }