From 7d701893a25606dc0812a04233bc9626537ffd3c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 8 May 2019 15:41:56 +0900 Subject: [PATCH] fix reading of the EOF in the HTTP/3 server Read([]byte{}) returns immediately, whereas Read([]byte{0}) blocks until the stream is actually closed. This make as difference if the STREAM frame with the FIN is received after the HTTP handler returned. --- http3/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http3/server.go b/http3/server.go index cc342a131..9e9711f6b 100644 --- a/http3/server.go +++ b/http3/server.go @@ -191,7 +191,7 @@ func (s *Server) handleRequest(str quic.Stream, decoder *qpack.Decoder) error { }() handler.ServeHTTP(responseWriter, req) // read the eof - if _, err = str.Read([]byte{}); err == io.EOF { + if _, err = str.Read([]byte{0}); err == io.EOF { readEOF = true } }()