]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Fix potential bug when adding new printers (Issue #934) 935/head
authorAndreas Karlson <a.karlson2608@hotmail.com>
Tue, 9 Apr 2024 13:14:22 +0000 (15:14 +0200)
committerAndreas Karlson <a.karlson2608@hotmail.com>
Tue, 9 Apr 2024 14:27:45 +0000 (16:27 +0200)
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.

scheduler/client.c

index c13cfbfa58d8adbf1dc8437b54913a602500e419..2dafd93116475964f8be64e53ee1b536badce417 100644 (file)
@@ -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()...
   */