mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 03:02:48 +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++
|
session.registrationMessages++
|
||||||
if client.server.Config().Limits.RegistrationMessages < 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"))
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if client.registered {
|
|
||||||
session.fakelag.Touch()
|
|
||||||
}
|
|
||||||
|
|
||||||
rb := NewResponseBuffer(session)
|
rb := NewResponseBuffer(session)
|
||||||
rb.Label = GetLabel(msg)
|
rb.Label = GetLabel(msg)
|
||||||
exiting := cmd.handler(server, client, msg, rb)
|
exiting := cmd.handler(server, client, msg, rb)
|
||||||
|
Loading…
Reference in New Issue
Block a user