1
0
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:
Bram Matthys
2023-07-09 13:20:26 +02:00
parent 93ea44680f
commit 3250c7c0b4
4 changed files with 38 additions and 0 deletions
+11
View File
@@ -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)
{