]> git.ipfire.org Git - pakfire.git/commitdiff
daemon: Remove the control connection from the HTTP client
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Feb 2025 15:44:41 +0000 (15:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Feb 2025 15:44:41 +0000 (15:44 +0000)
This is necessary after the connection was unexpectedly closed.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/daemon.c

index f8471d4945440d0e8accc99a209d3b2deaeac8b2..e2e65d080868f1594b974463de33b8c8c1761b26 100644 (file)
@@ -542,6 +542,13 @@ static int pakfire_daemon_close(struct pakfire_xfer* xfer, int code, void* data)
        struct pakfire_daemon* daemon = data;
        int r;
 
+       // Remove the connection from the client
+       r = pakfire_httpclient_dequeue(daemon->client, xfer);
+       if (r < 0) {
+               ERROR(daemon->ctx, "Failed to remove the control connection: %s\n", strerror(-r));
+               return r;
+       }
+
        // Drop the control connection
        if (daemon->control) {
                pakfire_xfer_unref(daemon->control);