SASL: Relax rate limiting for failures a little

Begin at 8 seconds after 2 failures and up to ~4 minutes
This commit is contained in:
Aaron Jones 2016-10-02 14:13:02 +00:00
parent 8e3d0668a4
commit 23f5c31719
No known key found for this signature in database
GPG key ID: EC6F86EE9CD840B5

View file

@ -255,7 +255,7 @@ me_sasl(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
* rate-limited immediately and not being able to login with SASL.
*/
if (target_p->localClient->sasl_failures++ > 0)
target_p->localClient->sasl_next_retry = rb_current_time() + (1 << MIN(target_p->localClient->sasl_failures + 5, 13));
target_p->localClient->sasl_next_retry = rb_current_time() + (1 << MIN(target_p->localClient->sasl_failures + 1, 8));
}
else if(throttle_add((struct sockaddr*)&target_p->localClient->ip))
{