diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Abandon a fill whose last flush fails to write
The slot being filled was forgotten before the page's final flush, so a
write that failed there, on a full disk for one, could not abandon the
fill: cgit died into the lock file instead and the visitor got nothing.
The mid-page path already delivered the page from the lock file.
Diffstat (limited to 'source')
| -rw-r--r-- | source/cache.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 4 insertions, 2 deletions
diff --git a/source/cache.c b/source/cache.c index a076823..82b3aad 100644 --- a/source/cache.c +++ b/source/cache.c @@ -370,12 +370,14 @@ static int fill_slot(struct cache_slot *slot) slot_being_filled = slot; slot->fn(); - slot_being_filled = NULL; // All of the page has to reach the lock file before it is renamed - // into place. After an abandoned fill stdout is the client again and + // into place, and a write that fails on this last flush still finds + // the slot to abandon, so the page goes to the visitor rather than + // nowhere. After an abandoned fill stdout is the client again and // this same flush delivers the tail of the error page instead. html_flush(); + slot_being_filled = NULL; if (fflush(stdout)) return errno; |
