优化代码

This commit is contained in:
刘祥超
2021-12-14 10:01:21 +08:00
parent e6ac085025
commit 014f433191
3 changed files with 21 additions and 11 deletions

View File

@@ -88,3 +88,15 @@ func (this *HTTPRateWriter) Hijack() (conn net.Conn, buf *bufio.ReadWriter, err
}
return
}
// Flush Flush
func (this *HTTPRateWriter) Flush() {
if this.parentWriter == nil {
return
}
flusher, ok := this.parentWriter.(http.Flusher)
if ok {
flusher.Flush()
return
}
}