From: Andreas Karlson Date: Tue, 9 Apr 2024 13:14:22 +0000 (+0200) Subject: scheduler: Fix potential bug when adding new printers (Issue #934) X-Git-Tag: v2.4.8~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F935%2Fhead;p=thirdparty%2Fcups.git scheduler: Fix potential bug when adding new printers (Issue #934) When adding a new printer a thread is created to handle PPD generation, and the requesting client connection might close while the thread is running. This commit prevents full connection cleanup until the thread is finished. --- diff --git a/scheduler/client.c b/scheduler/client.c index c13cfbfa58..2dafd93116 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -430,6 +430,14 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ con->file = -1; } + if (con->bg_pending) + { + /* + * Don't close connection when there is a background thread pending + */ + partial = 1; + } + /* * Close the socket and clear the file from the input set for select()... */