summary refs log tree commit diff
path: root/www/git.causal.agency/cgit/cache.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--www/git.causal.agency/cgit/cache.c (renamed from cache.c)7
1 files changed, 7 insertions, 0 deletions
diff --git a/cache.c b/www/git.causal.agency/cgit/cache.c
index 55199e8f..578b73b0 100644
--- a/cache.c
+++ b/www/git.causal.agency/cgit/cache.c
@@ -265,6 +265,13 @@ static int process_slot(struct cache_slot *slot)
 {
 	int err;
 
+	/*
+	 * Make sure any buffered data is flushed before we redirect,
+	 * do sendfile(2) or write(2)
+	 */
+	if (fflush(stdout))
+		return errno;
+
 	err = open_slot(slot);
 	if (!err && slot->match) {
 		if (is_expired(slot)) {