Fix writers for MJPEG and ASCII

This commit is contained in:
Alex X
2024-05-17 14:32:59 +03:00
parent f432e72dd0
commit d428a8964a
2 changed files with 10 additions and 6 deletions

View File

@@ -136,11 +136,13 @@ func (a *writer) Write(p []byte) (n int, err error) {
a.buf = append(a.buf, "\033[0m"...)
if n, err = a.wr.Write(a.buf); err == nil {
a.wr.(http.Flusher).Flush()
if _, err = a.wr.Write(a.buf); err != nil {
return 0, err
}
return
a.wr.(http.Flusher).Flush()
return len(p), nil
}
func gray(r, g, b uint32, k float32) uint8 {