Выпуск WDTT Plus v17

This commit is contained in:
Ivan4537 committed 2026-09-04 19:38:52 +03:00
1 parent 4be5f36c88
commit abf0a0f130
33 files changed
+763 -262

No files matched your search

+17 -1
View File
@@ -160,11 +160,27 @@ func sessionTURNCandidatesWithPreference(
sessionID int,
tp *TurnParams,
preferStream bool,
) []turnEndpoint {
return sessionTURNCandidatesForAttempt(rawURLs, sessionID, 0, tp, preferStream)
}
// sessionTURNCandidatesForAttempt rotates only the first TURN candidate after
// a relay accepted Allocate but did not carry the following DTLS handshake.
// The initial attempt keeps the historical endpoint order unchanged.
func sessionTURNCandidatesForAttempt(
rawURLs []string,
sessionID int,
retryOffset int,
tp *TurnParams,
preferStream bool,
) []turnEndpoint {
if len(rawURLs) == 0 {
return nil
}
selectedIndex := sessionID % len(rawURLs)
if retryOffset < 0 {
retryOffset = 0
}
selectedIndex := (sessionID + retryOffset) % len(rawURLs)
if selectedIndex < 0 {
selectedIndex = 0
}