# HG changeset patch # User Michael Pavone # Date 1588975189 25200 # Node ID f2d37131840eb9971b7946fd1a42716dbf93eecc # Parent 80920c21bb521e4d0687868a6be9f5d2fc4d9ce6 Fix "full" deflate flush so multiple remotes can successfully join diff -r 80920c21bb52 -r f2d37131840e event_log.c --- a/event_log.c Fri May 08 11:40:30 2020 -0700 +++ b/event_log.c Fri May 08 14:59:49 2020 -0700 @@ -357,7 +357,8 @@ void deflate_flush(uint8_t full) { output_stream.avail_in = buffer.size - (output_stream.next_in - buffer.data); - while (output_stream.avail_in) + uint8_t force = full; + while (output_stream.avail_in || force) { if (!output_stream.avail_out) { size_t old_storage = compressed_storage; @@ -376,12 +377,13 @@ if (result != (full ? Z_STREAM_END : Z_OK)) { fatal_error("deflate returned %d\n", result); } - if (full) { + if (full && result == Z_STREAM_END) { result = deflateReset(&output_stream); if (result != Z_OK) { fatal_error("deflateReset returned %d\n", result); } } + force = 0; } output_stream.next_in = buffer.data; buffer.size = 0;