mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
@@ -15,7 +15,7 @@ func Preconfig(dkill bool) {
|
|||||||
signal.Notify(sigc,
|
signal.Notify(sigc,
|
||||||
syscall.SIGHUP,
|
syscall.SIGHUP,
|
||||||
syscall.SIGINT,
|
syscall.SIGINT,
|
||||||
syscall.SIGSTOP,
|
|
||||||
syscall.SIGPIPE,
|
syscall.SIGPIPE,
|
||||||
syscall.SIGTERM,
|
syscall.SIGTERM,
|
||||||
syscall.SIGQUIT)
|
syscall.SIGQUIT)
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
bolt "go.etcd.io/bbolt"
|
|
||||||
"server/log"
|
"server/log"
|
||||||
|
|
||||||
|
bolt "go.etcd.io/bbolt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TDB struct {
|
type TDB struct {
|
||||||
@@ -99,7 +100,6 @@ func (v *TDB) Set(xpath, name string, value []byte) {
|
|||||||
log.TLogln("value:", value)
|
log.TLogln("value:", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *TDB) List(xpath string) []string {
|
func (v *TDB) List(xpath string) []string {
|
||||||
@@ -173,5 +173,4 @@ func (v *TDB) Rem(xpath, name string) {
|
|||||||
log.TLogln("Error rem sets", xpath+"/"+name, ", error:", err)
|
log.TLogln("Error rem sets", xpath+"/"+name, ", error:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,9 +82,7 @@ func (c *Cache) Piece(m metainfo.Piece) storage.PieceImpl {
|
|||||||
|
|
||||||
func (c *Cache) Close() error {
|
func (c *Cache) Close() error {
|
||||||
log.TLogln("Close cache for:", c.hash)
|
log.TLogln("Close cache for:", c.hash)
|
||||||
if _, ok := c.storage.caches[c.hash]; ok {
|
|
||||||
delete(c.storage.caches, c.hash)
|
delete(c.storage.caches, c.hash)
|
||||||
}
|
|
||||||
c.pieces = nil
|
c.pieces = nil
|
||||||
|
|
||||||
c.muReaders.Lock()
|
c.muReaders.Lock()
|
||||||
|
|||||||
@@ -359,9 +359,7 @@ func (t *Torrent) Close() {
|
|||||||
t.Stat = state.TorrentClosed
|
t.Stat = state.TorrentClosed
|
||||||
|
|
||||||
t.bt.mu.Lock()
|
t.bt.mu.Lock()
|
||||||
if _, ok := t.bt.torrents[t.Hash()]; ok {
|
|
||||||
delete(t.bt.torrents, t.Hash())
|
delete(t.bt.torrents, t.Hash())
|
||||||
}
|
|
||||||
t.bt.mu.Unlock()
|
t.bt.mu.Unlock()
|
||||||
|
|
||||||
t.drop()
|
t.drop()
|
||||||
|
|||||||
@@ -211,5 +211,5 @@ func streamNoAuth(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
c.Header("WWW-Authenticate", "Basic realm=Authorization Required")
|
c.Header("WWW-Authenticate", "Basic realm=Authorization Required")
|
||||||
c.AbortWithStatus(http.StatusUnauthorized)
|
c.AbortWithStatus(http.StatusUnauthorized)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user