mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-04 14:13:13 +02:00
Add some temporary safety mechanism if too many HTTP(S) requests in progress.
Will allow tweaking in config later. This is separate from rate-limit btw, which also still needs to be done.
This commit is contained in:
@@ -320,6 +320,17 @@ int _spamreport(Client *client, const char *ip, NameValuePrioList *details, cons
|
||||
char *url = NULL;
|
||||
char *body = NULL;
|
||||
NameValuePrioList *headers = NULL;
|
||||
int num;
|
||||
|
||||
num = downloads_in_progress();
|
||||
if (num > 100)
|
||||
{
|
||||
// TODO: throttle this error
|
||||
unreal_log(ULOG_WARNING, "spamreport", "SPAMREPORT_TOO_MANY_CONCURRENT_REQUESTS", NULL,
|
||||
"Already $num_requests HTTP(S) requests in progress, new spamreport requests ignored.",
|
||||
log_data_integer("num_requests", num));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!spamreport_block)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user