forked from quic-go/quic-go
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user