From d9bb874591c63f2efbfc1c4c953934251c700e9f Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 20 Mar 2023 03:32:00 +0100 Subject: Send response on quota exceeded So far, slcl would just close the connection with a client when the Content-Length of an incoming request exceeded the user quota, without any meaningful information given back to the user. Now, slcl responds with a HTML file with meaningful information about the error. Limitations: - While this commits has been successfully tested on ungoogled-chromium, LibreWolf (and I assume Firefox and any other derivates too) does not seem to receive the response from the server. - However, this issue only occurred during local testing, but not on remote instances. --- page.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'page.h') diff --git a/page.h b/page.h index 9df1eea..094a21e 100644 --- a/page.h +++ b/page.h @@ -17,5 +17,7 @@ int page_resource(struct http_response *r, const char *dir, const char *root, const char *res, const struct page_quota *q); int page_public(struct http_response *r, const char *res); int page_share(struct http_response *r, const char *path); +int page_quota_exceeded(struct http_response *r, unsigned long long len, + unsigned long long quota); #endif /* PAGE_H */ -- cgit v1.2.3