mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
Limit sent_parsed to the highest possible value in the current config.
After a configuration change (or deoper with no_oper_flood) sent_parsed might be way higher than allow_read, so that the user would have to wait a long time before the server responds. Avoid this.
This commit is contained in:
parent
a75bf40dad
commit
5a72f20c2c
1 changed files with 12 additions and 0 deletions
12
src/packet.c
12
src/packet.c
|
@ -84,6 +84,11 @@ parse_client_queued(struct Client *client_p)
|
|||
}
|
||||
|
||||
}
|
||||
/* If sent_parsed is impossibly high, drop it down.
|
||||
* This is useful if the configuration is changed.
|
||||
*/
|
||||
if(client_p->localClient->sent_parsed > allow_read)
|
||||
client_p->localClient->sent_parsed = allow_read;
|
||||
}
|
||||
|
||||
if(IsAnyServer(client_p) || IsExemptFlood(client_p))
|
||||
|
@ -143,6 +148,13 @@ parse_client_queued(struct Client *client_p)
|
|||
|
||||
client_p->localClient->sent_parsed += ConfigFileEntry.client_flood_message_time;
|
||||
}
|
||||
/* If sent_parsed is impossibly high, drop it down.
|
||||
* This is useful if the configuration is changed.
|
||||
*/
|
||||
if(client_p->localClient->sent_parsed > allow_read +
|
||||
ConfigFileEntry.client_flood_message_time - 1)
|
||||
client_p->localClient->sent_parsed = allow_read +
|
||||
ConfigFileEntry.client_flood_message_time - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue