forked from quic-go/quic-go
http3: implement FlushError for the response writer (#3951)
* implement FlushError interface for http3 response writer * move where to log flush error
This commit is contained in:
@@ -120,8 +120,12 @@ func (w *responseWriter) Write(p []byte) (int, error) {
|
|||||||
return w.bufferedStr.Write(p)
|
return w.bufferedStr.Write(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *responseWriter) FlushError() error {
|
||||||
|
return w.bufferedStr.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
func (w *responseWriter) Flush() {
|
func (w *responseWriter) Flush() {
|
||||||
if err := w.bufferedStr.Flush(); err != nil {
|
if err := w.FlushError(); err != nil {
|
||||||
w.logger.Errorf("could not flush to stream: %s", err.Error())
|
w.logger.Errorf("could not flush to stream: %s", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user