diff --git a/server/cmd/preconfig_pos.go b/server/cmd/preconfig_pos.go index aea3c80..a0be9fc 100644 --- a/server/cmd/preconfig_pos.go +++ b/server/cmd/preconfig_pos.go @@ -15,7 +15,7 @@ func Preconfig(dkill bool) { signal.Notify(sigc, syscall.SIGHUP, syscall.SIGINT, - syscall.SIGSTOP, + syscall.SIGPIPE, syscall.SIGTERM, syscall.SIGQUIT) diff --git a/server/settings/db.go b/server/settings/db.go index 137bbc5..d914ef8 100644 --- a/server/settings/db.go +++ b/server/settings/db.go @@ -4,8 +4,9 @@ import ( "path/filepath" "strings" - bolt "go.etcd.io/bbolt" "server/log" + + bolt "go.etcd.io/bbolt" ) type TDB struct { @@ -99,7 +100,6 @@ func (v *TDB) Set(xpath, name string, value []byte) { log.TLogln("value:", value) } - return } 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) } - return } diff --git a/server/torr/storage/torrstor/cache.go b/server/torr/storage/torrstor/cache.go index 0c1da13..605c5d8 100644 --- a/server/torr/storage/torrstor/cache.go +++ b/server/torr/storage/torrstor/cache.go @@ -82,9 +82,7 @@ func (c *Cache) Piece(m metainfo.Piece) storage.PieceImpl { func (c *Cache) Close() error { 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.muReaders.Lock() diff --git a/server/torr/torrent.go b/server/torr/torrent.go index 11ac52a..27f8eeb 100644 --- a/server/torr/torrent.go +++ b/server/torr/torrent.go @@ -359,9 +359,7 @@ func (t *Torrent) Close() { t.Stat = state.TorrentClosed 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.drop() diff --git a/server/web/api/stream.go b/server/web/api/stream.go index ff3226c..9c5f39e 100644 --- a/server/web/api/stream.go +++ b/server/web/api/stream.go @@ -211,5 +211,5 @@ func streamNoAuth(c *gin.Context) { } c.Header("WWW-Authenticate", "Basic realm=Authorization Required") c.AbortWithStatus(http.StatusUnauthorized) - return + }