From: msweet Date: Mon, 11 Jan 2016 20:27:08 +0000 (+0000) Subject: Pending subscriptions would prevent the scheduler from idle exiting (STR #4754) X-Git-Tag: v2.2b1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79d3cd17ccf629c385cad0cacb8ac1137d7519df;p=thirdparty%2Fcups.git 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 --- diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt index 51c784e725..2f60813df8 100644 --- a/CHANGES-2.1.txt +++ b/CHANGES-2.1.txt @@ -9,6 +9,8 @@ CHANGES IN CUPS V2.1.3 () - The EPL2 and ZPL sample drivers did not properly support the CutMedia option. + - Pending subscriptions would prevent the scheduler from idle exiting + (STR #4754) CHANGES IN CUPS V2.1.2 diff --git a/backend/lpd.c b/backend/lpd.c index d8ef9343b2..41f14913e7 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -594,7 +594,7 @@ cups_rresvport(int *port, /* IO - Port number to bind to */ */ memset(&addr, 0, sizeof(addr)); - addr.addr.sa_family = family; + addr.addr.sa_family = (sa_family_t)family; /* * Try to bind the socket to a reserved port... diff --git a/notifier/testnotify.c b/notifier/testnotify.c index c42bd84fc9..a7b8df4a7e 100644 --- a/notifier/testnotify.c +++ b/notifier/testnotify.c @@ -3,7 +3,7 @@ * * Test notifier for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2005 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -115,7 +115,7 @@ print_attributes(ipp_t *ipp, /* I - IPP request */ ippAttributeString(attr, buffer, sizeof(buffer)); - fprintf(stderr, "DEBUG: %*s%s (%s%s) %s", indent, "", attr->name, + fprintf(stderr, "DEBUG: %*s%s (%s%s) %s\n", indent, "", attr->name, attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), buffer); } diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 7a2fecd743..fda29e60c4 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 @@ -7254,6 +7254,12 @@ get_subscription_attrs( "get_subscription_attrs(con=%p[%d], sub_id=%d)", con, con->number, sub_id); + /* + * Expire subscriptions as needed... + */ + + cupsdExpireSubscriptions(NULL, NULL); + /* * Is the subscription ID valid? */ @@ -7403,6 +7409,12 @@ get_subscriptions(cupsd_client_t *con, /* I - Client connection */ return; } + /* + * 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 e03f88d790..0b171b5044 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 */ @@ -1710,19 +1709,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 diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index fd1d80e21e..ff14f45b04 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)) diff --git a/xcode/CUPS.xcodeproj/project.pbxproj b/xcode/CUPS.xcodeproj/project.pbxproj index c8c3bcfcec..9b9b93322b 100644 --- a/xcode/CUPS.xcodeproj/project.pbxproj +++ b/xcode/CUPS.xcodeproj/project.pbxproj @@ -3351,7 +3351,7 @@ 72BF96371333042100B1EAD7 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Apple Inc."; TargetAttributes = { 27A0347A1A8BDB1200650675 = {