mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix video playback hanging at end (#2996)
Co-authored-by: gerit1a <10052885+gerit1a@users.noreply.github.com>
This commit is contained in:
@@ -34,8 +34,21 @@ func (c *StreamRequestContext) Cancel() {
|
||||
}
|
||||
|
||||
// hijack and close the connection
|
||||
conn, _, _ := hj.Hijack()
|
||||
conn, bw, _ := hj.Hijack()
|
||||
if conn != nil {
|
||||
if bw != nil {
|
||||
// notify end of stream
|
||||
_, err := bw.WriteString("0\r\n")
|
||||
if err != nil {
|
||||
logger.Warnf("unable to write end of stream: %v", err)
|
||||
}
|
||||
_, err = bw.WriteString("\r\n")
|
||||
if err != nil {
|
||||
logger.Warnf("unable to write end of stream: %v", err)
|
||||
}
|
||||
_ = bw.Flush()
|
||||
}
|
||||
|
||||
conn.Close()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user