From f38fe3c42ec01efe37820b0c00dd79a66c80c0de Mon Sep 17 00:00:00 2001 From: stab Date: Tue, 31 Mar 2026 04:57:15 +0300 Subject: Added rate limiting and settings fixes. --- src/Limiter/RateLimit.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/Limiter/RateLimit.h (limited to 'src/Limiter/RateLimit.h') diff --git a/src/Limiter/RateLimit.h b/src/Limiter/RateLimit.h new file mode 100644 index 0000000..fabd05d --- /dev/null +++ b/src/Limiter/RateLimit.h @@ -0,0 +1,20 @@ +#ifndef RATE_LIMIT_H +#define RATE_LIMIT_H + +#include + +typedef struct { + int max_requests; + int interval_seconds; +} RateLimitConfig; + +typedef struct { + int limited; + int retry_after_seconds; +} RateLimitResult; + +void rate_limit_get_client_key(char *client_key, size_t client_key_size); +RateLimitResult rate_limit_check(const char *scope, + const RateLimitConfig *config); + +#endif -- cgit v1.2.3