3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

move fakelag processing back to read loop as well

This commit is contained in:
Shivaram Lingamneni 2019-05-22 18:35:24 -04:00
parent 4e13f72ca9
commit 05459012ef
2 changed files with 4 additions and 6 deletions

View File

@ -398,8 +398,10 @@ func (client *Client) run(session *Session) {
}
}
if client.registered {
session.fakelag.Touch()
} else {
// DoS hardening, #505
if !client.registered {
session.registrationMessages++
if client.server.Config().Limits.RegistrationMessages < session.registrationMessages {
client.Send(nil, client.server.name, ERR_UNKNOWNERROR, "*", client.t("You have sent too many registration messages"))

View File

@ -39,10 +39,6 @@ func (cmd *Command) Run(server *Server, client *Client, session *Session, msg ir
return false
}
if client.registered {
session.fakelag.Touch()
}
rb := NewResponseBuffer(session)
rb.Label = GetLabel(msg)
exiting := cmd.handler(server, client, msg, rb)