/*
* Sample IPP Everywhere server for CUPS.
*
- * Copyright 2010-2015 by Apple Inc.
+ * Copyright 2010-2017 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
buffer[4096]; /* Copy buffer */
ssize_t bytes; /* Bytes read */
cups_array_t *ra; /* Attributes to send in response */
+ _cups_thread_t t; /* Thread */
/*
* Process the job...
*/
- if (!_cupsThreadCreate((_cups_thread_func_t)process_job, job))
+ t = _cupsThreadCreate((_cups_thread_func_t)process_job, job);
+
+ if (t)
+ {
+ _cupsThreadDetach(t);
+ }
+ else
{
job->state = IPP_JSTATE_ABORTED;
respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to process job.");
* Process the job...
*/
-#if 0
- if (!_cupsThreadCreate((_cups_thread_func_t)process_job, job))
- {
- job->state = IPP_JSTATE_ABORTED;
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to process job.");
- return;
- }
-
-#else
process_job(job);
-#endif /* 0 */
/*
* Return the job info...
* Process the job...
*/
-#if 0
- if (!_cupsThreadCreate((_cups_thread_func_t)process_job, job))
- {
- job->state = IPP_JSTATE_ABORTED;
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to process job.");
- return;
- }
-
-#else
process_job(job);
-#endif /* 0 */
/*
* Return the job info...
* Process the job...
*/
-#if 0
- if (!_cupsThreadCreate((_cups_thread_func_t)process_job, job))
- {
- job->state = IPP_JSTATE_ABORTED;
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to process job.");
- return;
- }
-
-#else
process_job(job);
-#endif /* 0 */
/*
* Return the job info...
{
if ((client = create_client(printer, printer->ipv4)) != NULL)
{
- if (!_cupsThreadCreate((_cups_thread_func_t)process_client, client))
+ _cups_thread_t t = _cupsThreadCreate((_cups_thread_func_t)process_client, client);
+
+ if (t)
+ {
+ _cupsThreadDetach(t);
+ }
+ else
{
perror("Unable to create client thread");
delete_client(client);
{
if ((client = create_client(printer, printer->ipv6)) != NULL)
{
- if (!_cupsThreadCreate((_cups_thread_func_t)process_client, client))
+ _cups_thread_t t = _cupsThreadCreate((_cups_thread_func_t)process_client, client);
+
+ if (t)
+ {
+ _cupsThreadDetach(t);
+ }
+ else
{
perror("Unable to create client thread");
delete_client(client);