Added rate limiting and settings fixes.

This commit is contained in:
stab
2026-03-31 04:57:15 +03:00
committed by frosty
parent c3ed901738
commit f38fe3c42e
9 changed files with 363 additions and 1 deletions

View File

@@ -100,6 +100,16 @@ int load_config(const char *filename, Config *config) {
strncpy(config->engines, value, sizeof(config->engines) - 1);
config->engines[sizeof(config->engines) - 1] = '\0';
}
} else if (strcmp(section, "rate_limit") == 0) {
if (strcmp(key, "search_requests") == 0) {
config->rate_limit_search_requests = atoi(value);
} else if (strcmp(key, "search_interval") == 0) {
config->rate_limit_search_interval = atoi(value);
} else if (strcmp(key, "images_requests") == 0) {
config->rate_limit_images_requests = atoi(value);
} else if (strcmp(key, "images_interval") == 0) {
config->rate_limit_images_interval = atoi(value);
}
}
}
}