]> git.ipfire.org Git - pakfire.git/commitdiff
log file: Change compression to gzip
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 08:21:25 +0000 (08:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 08:25:34 +0000 (08:25 +0000)
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 <michael.tremer@ipfire.org>
src/pakfire/job.c
src/pakfire/log_file.c

index 620b32f948349c593195b6e09ba29dad3e2c290f..a02419fc85e07b6992776e141fde3bb5ceab13e8 100644 (file)
@@ -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) {
index ca75eef7254984b59aec09fc898721aa3fa393a8..0c961405d6eeda2aa7c38ce4348a070c439c2040 100644 (file)
@@ -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;
        }