diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2016-01-11 20:27:08 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2016-01-11 20:27:08 +0000 |
commit | 79d3cd17ccf629c385cad0cacb8ac1137d7519df (patch) | |
tree | db3ab2cd6b2ab360acbceb5f4d999785435ade61 /scheduler | |
parent | 6d7669cc0a8120ba9b2586c864ad105628bba311 (diff) |
Pending subscriptions would prevent the scheduler from idle exiting (STR #4754)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13039 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/ipp.c | 14 | ||||
-rw-r--r-- | scheduler/main.c | 16 | ||||
-rw-r--r-- | scheduler/subscriptions.c | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 7a2fecd74..fda29e60c 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -3,7 +3,7 @@ * * IPP routines for the CUPS scheduler. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * This file contains Kerberos support code, copyright 2006 by @@ -7255,6 +7255,12 @@ get_subscription_attrs( con, con->number, sub_id); /* + * Expire subscriptions as needed... + */ + + cupsdExpireSubscriptions(NULL, NULL); + + /* * Is the subscription ID valid? */ @@ -7404,6 +7410,12 @@ get_subscriptions(cupsd_client_t *con, /* I - Client connection */ } /* + * Expire subscriptions as needed... + */ + + cupsdExpireSubscriptions(NULL, NULL); + + /* * Copy the subscription attributes to the response using the * requested-attributes attribute that may be provided by the client. */ diff --git a/scheduler/main.c b/scheduler/main.c index e03f88d79..0b171b504 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -3,7 +3,7 @@ * * Main loop for the CUPS scheduler. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -1573,7 +1573,6 @@ select_timeout(int fds) /* I - Number of descriptors returned */ time_t now; /* Current time */ cupsd_client_t *con; /* Client information */ cupsd_job_t *job; /* Job information */ - cupsd_subscription_t *sub; /* Subscription information */ const char *why; /* Debugging aid */ @@ -1711,19 +1710,6 @@ select_timeout(int fds) /* I - Number of descriptors returned */ #endif /* HAVE_MALLINFO */ /* - * Expire subscriptions as needed... - */ - - for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); - sub; - sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions)) - if (!sub->job && sub->expire && sub->expire < timeout) - { - timeout = sub->expire; - why = "expire subscription"; - } - - /* * Adjust from absolute to relative time. We add 1 second to the timeout since * events occur after the timeout expires, and limit the timeout to 86400 * seconds (1 day) to avoid select() timeout limits present on some operating diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index fd1d80e21..ff14f45b0 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -657,6 +657,8 @@ cupsdExpireSubscriptions( curtime = time(NULL); update = 0; + cupsdLogMessage(CUPSD_LOG_INFO, "Expiring subscriptions..."); + for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); sub; sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions)) |