summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2016-01-11 20:27:08 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2016-01-11 20:27:08 +0000
commit79d3cd17ccf629c385cad0cacb8ac1137d7519df (patch)
treedb3ab2cd6b2ab360acbceb5f4d999785435ade61
parent6d7669cc0a8120ba9b2586c864ad105628bba311 (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
-rw-r--r--CHANGES-2.1.txt2
-rw-r--r--backend/lpd.c2
-rw-r--r--notifier/testnotify.c4
-rw-r--r--scheduler/ipp.c14
-rw-r--r--scheduler/main.c16
-rw-r--r--scheduler/subscriptions.c2
-rw-r--r--xcode/CUPS.xcodeproj/project.pbxproj2
7 files changed, 22 insertions, 20 deletions
diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt
index 51c784e72..2f60813df 100644
--- a/CHANGES-2.1.txt
+++ b/CHANGES-2.1.txt
@@ -9,6 +9,8 @@ CHANGES IN CUPS V2.1.3
(<rdar://problem/23255001>)
- 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 d8ef9343b..41f14913e 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 c42bd84fc..a7b8df4a7 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 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))
diff --git a/xcode/CUPS.xcodeproj/project.pbxproj b/xcode/CUPS.xcodeproj/project.pbxproj
index c8c3bcfce..9b9b93322 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 = {