From 969e9554a31385b2d2c09695dab984d585dc2693 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Mon, 21 Sep 2026 06:42:39 -1000 Subject: Harden the request path, scan and error recovery --- source/html.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/html.h') diff --git a/source/html.h b/source/html.h index 410661b..46b445f 100644 --- a/source/html.h +++ b/source/html.h @@ -12,10 +12,9 @@ #include "cgit.h" -// How much of a generated run to build before handing it to html_raw. Growing -// past this gains nothing, since html_raw gathers what it is given into a -// buffer of its own, and a run built whole would grow with the file it came -// from, to many times the blob's size, which max-blob-size never measures. +// How much of a generated run to build before handing it to html_raw. A run +// built whole would grow with the file it came from, to many times the blob's +// size, which max-blob-size never measures. #define HTML_BATCH (64 * 1024) extern void html_raw(const char *txt, size_t size); @@ -27,6 +26,11 @@ extern void html(const char *txt); */ extern void html_flush(void); +/* + * Drop whatever page output is still buffered. For the die path only. + */ +extern void html_discard(void); + /* * Collect page output into sb rather than writing it, until html_capture_end. * A capture must not span a filter or anything else that writes to stdout -- cgit v2.8.0