forked from External/ergo
tweak to avoid a potential data race
This commit is contained in:
parent
b468baa959
commit
4b37b5dd3e
1 changed files with 3 additions and 3 deletions
|
|
@ -327,11 +327,11 @@ func (client *Client) lookupHostname(session *Session, overwrite bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
session.rawHostname = hostname
|
session.rawHostname = hostname
|
||||||
// update the hostname if this is a new connection or a resume, but not if it's a reattach
|
|
||||||
if overwrite || client.rawHostname == "" {
|
|
||||||
cloakedHostname := config.Server.Cloaks.ComputeCloak(ip)
|
cloakedHostname := config.Server.Cloaks.ComputeCloak(ip)
|
||||||
client.stateMutex.Lock()
|
client.stateMutex.Lock()
|
||||||
defer client.stateMutex.Unlock()
|
defer client.stateMutex.Unlock()
|
||||||
|
// update the hostname if this is a new connection or a resume, but not if it's a reattach
|
||||||
|
if overwrite || client.rawHostname == "" {
|
||||||
client.rawHostname = hostname
|
client.rawHostname = hostname
|
||||||
client.cloakedHostname = cloakedHostname
|
client.cloakedHostname = cloakedHostname
|
||||||
client.updateNickMaskNoMutex()
|
client.updateNickMaskNoMutex()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue