From 1b4edf879b5f37dd32da8c525c730ebfcb110eef Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Wed, 1 Sep 2021 14:28:24 +0300 Subject: [PATCH] Set GZIP internal buffer size to 256k (default 8k) --- src/filehandling.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/filehandling.c b/src/filehandling.c index 48c2831b2..d1c094535 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -9,6 +9,10 @@ #include "shared.h" #include "filehandling.h" +#ifndef HCFILE_BUFFER_SIZE +#define HCFILE_BUFFER_SIZE 256 * 1024 +#endif + #if defined (__CYGWIN__) // workaround for zlib with cygwin build int _wopen (const char *path, int oflag, ...) @@ -112,6 +116,8 @@ bool hc_fopen (HCFILE *fp, const char *path, const char *mode) if (is_gzip) { if ((fp->gfp = gzdopen (fp->fd, mode)) == NULL) return false; + + gzbuffer (fp->gfp, HCFILE_BUFFER_SIZE); } else {