fix(vkauth): сбрасывать реквизиты при неподтверждённом deallocate
This commit is contained in:
1 parent
c2a9f0f1d7
commit
7fc7fe2e79
9 files changed
+61
-13
No files matched your search
@@ -252,9 +252,8 @@ func oneTURN(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr,
|
||||
cerr := stream.Close()
|
||||
deps.log().Infof("[STREAM %d] TURN allocation released: relayed=%s deallocate=%v",
|
||||
streamID, relayedAddr, cerr)
|
||||
// Ошибку закрытия не ставим поверх причины выхода - она уже сказала, почему стрим упал.
|
||||
if cerr != nil && err == nil {
|
||||
err = fmt.Errorf("failed to close TURN stream: %w", cerr)
|
||||
if cerr != nil {
|
||||
deps.Auth.DropCredentials(streamID)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ type AuthHandler interface {
|
||||
IsAuthError(err error) bool
|
||||
HandleAuthError(streamID int) bool
|
||||
ResetErrors(streamID int)
|
||||
DropCredentials(streamID int)
|
||||
BackoffUntilUnix() int64
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user