diff options
| author | stab <stab@stab.ing> | 2026-03-31 04:57:15 +0300 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-03-31 05:10:22 +0300 |
| commit | f38fe3c42ec01efe37820b0c00dd79a66c80c0de (patch) | |
| tree | 2af9e878661738d51efee43bbc9998bead3bf078 /src/Config.c | |
| parent | c3ed9017385342944badec46de263560c6ab07c8 (diff) | |
| download | omnisearch-f38fe3c42ec01efe37820b0c00dd79a66c80c0de.tar.gz | |
Added rate limiting and settings fixes.
Diffstat (limited to 'src/Config.c')
| -rw-r--r-- | src/Config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Config.c b/src/Config.c index 0c3fc1c..c4bd1f1 100644 --- a/src/Config.c +++ b/src/Config.c @@ -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); + } } } } |
