mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
mitigate #772
This commit is contained in:
parent
e71a3a57f0
commit
a3f008e348
@ -955,6 +955,10 @@ func (client *Client) updateNick(nick, nickCasefolded, skeleton string) {
|
||||
|
||||
// updateNickMaskNoMutex updates the casefolded nickname and nickmask, not acquiring any mutexes.
|
||||
func (client *Client) updateNickMaskNoMutex() {
|
||||
if client.nick == "*" {
|
||||
return // pre-registration, don't bother generating the hostname
|
||||
}
|
||||
|
||||
client.hostname = client.getVHostNoMutex()
|
||||
if client.hostname == "" {
|
||||
client.hostname = client.cloakedHostname
|
||||
@ -963,10 +967,6 @@ func (client *Client) updateNickMaskNoMutex() {
|
||||
}
|
||||
}
|
||||
|
||||
if client.hostname == "" {
|
||||
return // pre-registration, don't bother generating the hostname
|
||||
}
|
||||
|
||||
cfhostname := strings.ToLower(client.hostname)
|
||||
client.nickMaskString = fmt.Sprintf("%s!%s@%s", client.nick, client.username, client.hostname)
|
||||
client.nickMaskCasefolded = fmt.Sprintf("%s!%s@%s", client.nickCasefolded, strings.ToLower(client.username), cfhostname)
|
||||
|
@ -331,6 +331,12 @@ func (server *Server) tryRegister(c *Client, session *Session) (exiting bool) {
|
||||
return true
|
||||
}
|
||||
|
||||
// we have the final value of the IP address: do the hostname lookup
|
||||
// (nickmask will be set below once nickname assignment succeeds)
|
||||
if session.rawHostname == "" {
|
||||
session.client.lookupHostname(session, false)
|
||||
}
|
||||
|
||||
rb := NewResponseBuffer(session)
|
||||
nickAssigned := performNickChange(server, c, c, session, c.preregNick, rb)
|
||||
rb.Send(true)
|
||||
@ -339,10 +345,6 @@ func (server *Server) tryRegister(c *Client, session *Session) (exiting bool) {
|
||||
return
|
||||
}
|
||||
|
||||
// we have nickname, username, and the final value of the IP address:
|
||||
// do the hostname lookup and set the nickmask
|
||||
session.client.lookupHostname(session, false)
|
||||
|
||||
if session.client != c {
|
||||
// reattached, bail out.
|
||||
// we'll play the reg burst later, on the new goroutine associated with
|
||||
|
Loading…
Reference in New Issue
Block a user