chore: using atomic.Pointer in anytls

This commit is contained in:
wwqgtxx
2025-08-14 00:51:55 +08:00
parent 0408da2aee
commit f90d0b954c
5 changed files with 13 additions and 13 deletions

View File

@@ -7,8 +7,8 @@ import (
"math/big"
"strconv"
"strings"
"sync/atomic"
"github.com/metacubex/mihomo/common/atomic"
"github.com/metacubex/mihomo/transport/anytls/util"
)
@@ -31,7 +31,7 @@ type PaddingFactory struct {
Md5 string
}
func UpdatePaddingScheme(rawScheme []byte, to *atomic.TypedValue[*PaddingFactory]) bool {
func UpdatePaddingScheme(rawScheme []byte, to *atomic.Pointer[PaddingFactory]) bool {
if p := NewPaddingFactory(rawScheme); p != nil {
to.Store(p)
return true