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:
parent
4e13f72ca9
commit
05459012ef
@ -398,8 +398,10 @@ func (client *Client) run(session *Session) {
|
||||
}
|
||||
}
|
||||
|
||||
// DoS hardening, #505
|
||||
if !client.registered {
|
||||
if client.registered {
|
||||
session.fakelag.Touch()
|
||||
} else {
|
||||
// DoS hardening, #505
|
||||
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"))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user