mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-27 05:34:15 +00:00
Use LoadOrStore
This commit is contained in:
parent
4bc9f8ed37
commit
936fc0507f
1 changed files with 1 additions and 2 deletions
|
@ -387,8 +387,7 @@ func (w *PacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
|||
} else {
|
||||
ip := w.Handler.resolveIP(w.Context, b.UDP.Address.Domain(), nil)
|
||||
if ip != nil {
|
||||
b.UDP.Address = ip
|
||||
w.resolvedUDPAddr.Store(b.UDP.Address.Domain(), ip)
|
||||
b.UDP.Address, _ = w.resolvedUDPAddr.LoadOrStore(b.UDP.Address.Domain(), ip)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue