mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-17 23:51:53 +01:00
Don't apply fake lag to servers
This commit is contained in:
parent
fb0842216f
commit
910477c94a
1 changed files with 14 additions and 3 deletions
17
src/bsd.c
17
src/bsd.c
|
@ -1060,6 +1060,19 @@ void proceed_normal_client_handshake(Client *client, struct hostent *he)
|
|||
finish_auth(client);
|
||||
}
|
||||
|
||||
int client_lagged_up(Client *client)
|
||||
{
|
||||
if (client->status < CLIENT_STATUS_UNKNOWN)
|
||||
return 0;
|
||||
if (IsServer(client))
|
||||
return 0;
|
||||
if (ValidatePermissionsForPath("immune:lag",client,NULL,NULL,NULL))
|
||||
return 0;
|
||||
if (client->local->since - TStime() < 10)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
** read_packet
|
||||
**
|
||||
|
@ -1080,7 +1093,6 @@ void proceed_normal_client_handshake(Client *client, struct hostent *he)
|
|||
static void parse_client_queued(Client *client)
|
||||
{
|
||||
int dolen = 0;
|
||||
time_t now = TStime();
|
||||
char buf[READBUFSIZE];
|
||||
|
||||
if (IsDNSLookup(client))
|
||||
|
@ -1095,8 +1107,7 @@ static void parse_client_queued(Client *client)
|
|||
return; /* we delay processing of data until set::handshake-delay is reached */
|
||||
}
|
||||
|
||||
while (DBufLength(&client->local->recvQ) &&
|
||||
((client->status < CLIENT_STATUS_UNKNOWN) || (client->local->since - now < 10)))
|
||||
while (DBufLength(&client->local->recvQ) && !client_lagged_up(client))
|
||||
{
|
||||
dolen = dbuf_getmsg(&client->local->recvQ, buf);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue