Skip to content

Commit 6aeb03b

Browse files
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.
1 parent dce85e1 commit 6aeb03b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scheduler/client.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */
430430
con->file = -1;
431431
}
432432

433+
if (con->bg_pending)
434+
{
435+
/*
436+
* Don't close connection when there is a background thread pending
437+
*/
438+
partial = 1;
439+
}
440+
433441
/*
434442
* Close the socket and clear the file from the input set for select()...
435443
*/

0 commit comments

Comments
 (0)