diff options
Diffstat (limited to 'source/ui-shared.c')
| -rw-r--r-- | source/ui-shared.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index 066c25d..05fa30b 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -10,6 +10,7 @@ #define USE_THE_REPOSITORY_VARIABLE +#include "cache.h" #include "cgit.h" #include "html.h" #include "shared.h" @@ -1293,6 +1294,11 @@ void cgit_print_error_page(int code, const char *msg, const char *fmt, ...) void cgit_vprint_error_page(int code, const char *msg, const char *fmt, va_list ap) { + // An error page describes a condition that may not outlast the slot + // holding it. A request naming a commit not yet pushed would cache its + // 404 under the never-expiring static ttl and keep serving it after + // the push, so the error is rendered straight to the visitor instead. + cache_abandon_fill(); ctx.page.status = code; ctx.page.statusmsg = msg; cgit_print_layout_start(); |
