From: Michael Tremer Date: Sun, 13 Oct 2024 10:24:05 +0000 (+0000) Subject: httpclient: Don't run the main loop if there are no transfers X-Git-Tag: 0.9.30~1045 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10a935c5998aba4827288f6c3ffda92e6e7c8ff8;p=pakfire.git httpclient: Don't run the main loop if there are no transfers Signed-off-by: Michael Tremer --- 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)