diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-12-09 12:10:05 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-12-09 12:10:05 +0100 |
commit | 3bcdd6e1ef5d6f601a35824fedde2af048fef633 (patch) | |
tree | 4653462a5eea3dd9fef8723f04d34dddd5e20571 /content.go | |
parent | 6a2fbd1434138094474a9f8901dc7f351bc4388c (diff) |
count any contentConn disconnect that wasn't initiated by us as an error
This fixes connection failures not denying a client access to a media pool (#141).
Diffstat (limited to 'content.go')
-rw-r--r-- | content.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -32,7 +32,7 @@ type mediaFile struct { type contentConn struct { mt.Peer - denied bool + success bool logger *log.Logger @@ -229,7 +229,6 @@ func handleContent(cc *contentConn) { M: M, }) case *mt.ToCltKick: - cc.denied = true cc.log("<-", "deny access", cmd) case *mt.ToCltAcceptAuth: cc.auth.method = 0 @@ -286,6 +285,8 @@ func handleContent(cc *contentConn) { if cmd.I == cmd.N-1 { cc.updateCache() cc.Close() + + cc.success = true } } } @@ -356,7 +357,7 @@ func muxErrors(conns []*contentConn) map[string]struct{} { for _, cc := range conns { <-cc.done() - if cc.denied { + if !cc.success { denyPools[cc.mediaPool] = struct{}{} } } |