From 10a935c5998aba4827288f6c3ffda92e6e7c8ff8 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 13 Oct 2024 10:24:05 +0000 Subject: [PATCH] httpclient: Don't run the main loop if there are no transfers Signed-off-by: Michael Tremer --- src/libpakfire/httpclient.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libpakfire/httpclient.c b/src/libpakfire/httpclient.c index 1574ac433..5be5671df 100644 --- a/src/libpakfire/httpclient.c +++ b/src/libpakfire/httpclient.c @@ -508,6 +508,12 @@ int pakfire_httpclient_remove_xfer(struct pakfire_httpclient* client, int pakfire_httpclient_run(struct pakfire_httpclient* client, const char* title) { int r = 0; + // Cannot run without any transfers + if (!client->total_xfers) { + CTX_DEBUG(client->ctx, "Skipping running HTTP client without any transfers\n"); + return 0; + } + // Set the title r = pakfire_progress_set_title(client->progress, "%s", title); if (r) -- 2.47.3