From: Michael Tremer Date: Thu, 30 Jan 2025 08:21:25 +0000 (+0000) Subject: log file: Change compression to gzip X-Git-Tag: 0.9.30~288 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b8760b813f208e55d0e3ac1b9c2c22db3a7d9c0;p=pakfire.git log file: Change compression to gzip Although it would be nice to only use one compression algorithm, the challenges to use Zstandard are a little bit too large. The compression is actually not better (if even) and takes up a lot more resources. At the same time, there is very little support for Zstandard in browsers and Python itself, which results us writing a lot of extra code to ensure that the files are often decoded again to be delivered in plaintext and being DEFLATEd again by the reverse proxies. So it all makes a lot more sense to use gzip from the start and just be done with it. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/job.c b/src/pakfire/job.c index 620b32f9..a02419fc 100644 --- a/src/pakfire/job.c +++ b/src/pakfire/job.c @@ -629,8 +629,10 @@ static void pakfire_job_log(void* data, int priority, const char* file, } } +#if 0 // Pass everything on to syslog pakfire_log_syslog(NULL, priority, file, line, fn, format, args); +#endif } static int pakfire_job_child(struct pakfire_job* job) { diff --git a/src/pakfire/log_file.c b/src/pakfire/log_file.c index ca75eef7..0c961405 100644 --- a/src/pakfire/log_file.c +++ b/src/pakfire/log_file.c @@ -94,7 +94,7 @@ int pakfire_log_file_create(struct pakfire_log_file** file, struct pakfire_ctx* // If we want to write the log file compressed, we replace the file handle if (self->flags & PAKFIRE_LOG_FILE_COMPRESS) { - self->f = pakfire_zstdfopen(self->f, "w"); + self->f = pakfire_gzfopen(self->f, "w"); if (!self->f) { ERROR(self->ctx, "Could not enable compression for log file: %m\n"); r = -errno; @@ -102,7 +102,7 @@ int pakfire_log_file_create(struct pakfire_log_file** file, struct pakfire_ctx* } // Add a suffix to the filename - r = pakfire_string_append(self->filename, ".zst"); + r = pakfire_string_append(self->filename, ".gz"); if (r < 0) goto ERROR; }