HLS client: flush buffers after every write
This commit is contained in:
parent
9350019262
commit
ec3e9230ed
|
@ -110,7 +110,20 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
res := <-cres
|
||||
|
||||
if res != nil {
|
||||
io.Copy(w, res)
|
||||
buf := make([]byte, 4096)
|
||||
for {
|
||||
n, err := res.Read(buf)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = w.Write(buf[:n])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
w.(http.Flusher).Flush()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue