From: Michael Tremer Date: Wed, 25 Jun 2025 11:16:21 +0000 (+0000) Subject: client: Automatically remove uploads from queue on free X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b38a9264a42c48dd23d55f823652f61c953dc60;p=pakfire.git client: Automatically remove uploads from queue on free Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/client.c b/src/pakfire/client.c index 3c3f4314..e4d2c0e9 100644 --- a/src/pakfire/client.c +++ b/src/pakfire/client.c @@ -598,6 +598,12 @@ ERROR: // Uploads static void pakfire_client_upload_free(struct pakfire_client_upload* upload) { + struct pakfire_client* client = upload->client; + + // Remove the upload from the queue (if present) + if (client) + STAILQ_REMOVE(&client->uploads, upload, pakfire_client_upload, nodes); + // Close the file handle if (upload->f) fclose(upload->f); @@ -681,10 +687,6 @@ ERROR: return r; } -static void pakfire_client_upload_remove(struct pakfire_client* self, struct pakfire_client_upload* upload) { - STAILQ_REMOVE(&self->uploads, upload, pakfire_client_upload, nodes); -} - static int pakfire_client_upload_payload(struct pakfire_client_upload* upload) { struct pakfire_client* self = upload->client; struct pakfire_xfer* xfer = NULL;