names for the server when using GNU TLS (Issue #5525)
- Fixed a potential crash bug in cups-driverd (rdar://46625579)
- Fixed a performance regression with large PPDs (rdar://47040759)
+- The scheduler did not always idle exit as quickly as it could.
Changes in CUPS v2.2.10
/*
* Main loop for the CUPS scheduler.
*
- * Copyright 2007-2018 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* inactivity...
*/
- if (timeout == 86400 && OnDemand && IdleExitTimeout &&
- !cupsArrayCount(ActiveJobs) &&
+ if (OnDemand && IdleExitTimeout &&
# ifdef HAVE_SYSTEMD
!WebInterface &&
# endif /* HAVE_SYSTEMD */
- (!Browsing || !BrowseLocalProtocols || !cupsArrayCount(Printers)))
+ !cupsArrayCount(ActiveJobs))
{
- timeout = IdleExitTimeout;
- service_idle_exit = 1;
+ cupsd_printer_t *p = NULL; /* Current printer */
+
+ if (Browsing && BrowseLocalProtocols)
+ {
+ for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); p; p = (cupsd_printer_t *)cupsArrayNext(Printers))
+ if (p->shared)
+ break;
+ }
+
+ if (!p)
+ {
+ timeout = IdleExitTimeout;
+ service_idle_exit = 1;
+ }
}
else
service_idle_exit = 0;
if (current_time > expire_time)
{
- if (cupsArrayCount(Subscriptions) > 0)
- cupsdExpireSubscriptions(NULL, NULL);
+ cupsdExpireSubscriptions(NULL, NULL);
cupsdUnloadCompletedJobs();
/*
* Server start/stop routines for the CUPS scheduler.
*
- * Copyright 2007-2018 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
cupsdDestroyProfile(DefaultProfile);
DefaultProfile = NULL;
+ /*
+ * Expire subscriptions and clean out old jobs...
+ */
+
+ cupsdExpireSubscriptions(NULL, NULL);
+
+ if (JobHistoryUpdate)
+ cupsdCleanJobs();
+
/*
* Write out any dirty files...
*/
/*
* Subscription routines for the CUPS scheduler.
*
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
time_t curtime; /* Current time */
+ if (cupsArrayCount(Subscriptions) == 0)
+ return;
+
curtime = time(NULL);
update = 0;