fix(tunnel): обработка защиты сокетов и стабильность прямого режима

This commit is contained in:
samosvalishe committed 2026-09-07 02:37:54 +03:00
1 parent 67f9a4fe4e
commit 1cc5e93d03
8 files changed
+102 -20

No files matched your search

+6 -2
View File
@@ -174,8 +174,6 @@ func Wake() {
// Reconnect пересоздаёт TURN-аллокации, не трогая туннель и tun-дескриптор.
// В прямом режиме вместо них пересоздаются сокеты bind.
func Reconnect() {
mu.Lock()
defer mu.Unlock()
l := current.Load()
if l == nil {
return
@@ -184,6 +182,12 @@ func Reconnect() {
l.sess.Reconnect()
return
}
mu.Lock()
defer mu.Unlock()
l = current.Load()
if l == nil || !l.direct() {
return
}
if r, ok := l.tunnel.backend.(tunnel.Rebinder); ok {
if err := r.Rebind(); err != nil {
coreLog().Warnf("%v", err)