From 82cc1f9ac32564e92bfbbe7a1de416f4ebcc8584 Mon Sep 17 00:00:00 2001
From: msweet
Date: Fri, 30 Mar 2012 05:59:14 +0000
Subject: [PATCH] Merge changes from CUPS 1.6svn-r10390.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@3755 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES-1.5.txt | 12 +
CHANGES-IPPTOOL.txt | 13 +-
CHANGES.txt | 14 +-
Makedefs.in | 2 +
backend/backend-private.h | 16 +-
backend/dnssd.c | 15 +-
backend/ipp.c | 72 +-
backend/network.c | 32 +-
backend/runloop.c | 30 +-
backend/snmp-supplies.c | 77 +-
backend/testbackend.c | 14 +-
berkeley/lpc.c | 5 +-
cgi-bin/admin.c | 56 +-
cgi-bin/help.c | 25 +-
cgi-bin/var.c | 6 +
config-scripts/cups-common.m4 | 14 +-
config-scripts/cups-defaults.m4 | 12 +-
config-scripts/cups-ssl.m4 | 12 +-
config-scripts/cups-ssl.m4.orig | 179 +++
config.h.in | 8 +
cups/api-httpipp.shtml | 98 +-
cups/cups-private.h | 6 +-
cups/cups.h | 7 +-
cups/dest-job.c | 249 +++-
cups/dest-options.c | 6 +-
cups/dest.c | 12 +-
cups/http-addrlist.c | 4 +-
cups/http-support.c | 10 +-
cups/http.c | 8 +-
cups/ipp-private.h | 97 --
cups/ipp-support.c | 11 +-
cups/ipp.c | 46 +-
cups/ipp.h | 126 +-
cups/language.c | 46 +-
cups/ppd-cache.c | 11 +-
cups/ppd.c | 4 +-
cups/ppd.h | 16 +-
cups/pwg-media.c | 2 +-
cups/request.c | 9 +-
cups/sidechannel.c | 14 +-
cups/snmp-private.h | 5 +-
cups/testconflicts.c | 13 +-
cups/util.c | 2 +-
doc/help/api-httpipp.html | 108 +-
doc/help/api-ppdc.html | 3 +
doc/help/man-ipptoolfile.html | 63 +-
doc/help/ref-cupsd-conf.html.in | 145 +-
doc/help/spec-ppd.html | 21 +-
doc/index.html.in | 2 +-
filter/commandtops.c | 207 ++-
filter/spec-ppd.shtml | 20 +-
install-sh | 20 +-
locale/cups.pot | 985 +++++++-------
locale/cups.strings | 7 +-
locale/po2strings.c | 23 +-
man/ipptoolfile.man | 53 +-
notifier/rss.c | 13 +-
ppdc/ppdc-file.cxx | 7 +-
ppdc/ppdc-source.cxx | 5 +-
ppdc/ppdc.h | 1 +
scheduler/Makefile | 7 +-
scheduler/auth.c | 4 +-
scheduler/client.c | 1093 +--------------
scheduler/client.h | 5 +
scheduler/client.h.orig | 139 ++
scheduler/conf.c | 104 +-
scheduler/cups-driverd.cxx | 1698 ++++++++++++++----------
scheduler/cups-lpd.c | 2 +-
scheduler/cupsd.h | 6 +-
scheduler/job.c | 450 ++++---
scheduler/job.h | 13 +-
scheduler/main.c | 36 +-
scheduler/network.c | 6 +-
scheduler/printers.c | 3 +-
scheduler/tls-darwin.c | 560 ++++++++
scheduler/tls-gnutls.c | 292 ++++
scheduler/tls-openssl.c | 353 +++++
scheduler/tls.c | 30 +
systemv/cupstestppd.c | 34 +-
templates/admin.tmpl | 9 +-
templates/help-header.tmpl | 2 +-
templates/jobs.tmpl | 2 +-
templates/trailer.tmpl | 2 +-
test/Makefile | 29 +-
test/ipp-1.1.test | 6 +-
test/ipp-2.0.test | 12 +-
test/ipptool.c | 238 ++--
test/run-stp-tests.sh | 12 +-
vcnet/config.h | 6 +-
vcnet/cups.sln | 10 +
vcnet/libcups2-installer.vdproj | 2194 +++++++++++++++++++++++++++++++
91 files changed, 7386 insertions(+), 3070 deletions(-)
create mode 100644 config-scripts/cups-ssl.m4.orig
create mode 100644 scheduler/client.h.orig
create mode 100644 scheduler/tls-darwin.c
create mode 100644 scheduler/tls-gnutls.c
create mode 100644 scheduler/tls-openssl.c
create mode 100644 scheduler/tls.c
create mode 100644 vcnet/libcups2-installer.vdproj
diff --git a/CHANGES-1.5.txt b/CHANGES-1.5.txt
index 3250d60aa..344c5eda2 100644
--- a/CHANGES-1.5.txt
+++ b/CHANGES-1.5.txt
@@ -3,6 +3,18 @@ CHANGES-1.5.txt
CHANGES IN CUPS V1.5.3
+ - Fixed compile problem with old versions of OpenSSL (STR #4036)
+ - The network backends did not check SNMP supply levels regularly
+ (STR #4040)
+ - The online help always included the "help on help" text (STR #4042)
+ - Fixed a SSL handshake issue on OS X (STR #4045)
+ - The scheduler could crash if a PPD file contained an invalid paper
+ size (STR #4049)
+ - The CUPS polling daemon did not reinitialize its connection to the
+ remote server on errors in all cases (STR #4031)
+ - PostScript auto-configuration was slow and unreliable with some
+ printers (STR #4028)
+ - Missing localizations caused empty output (STR #4033)
- The cups-driverd program could temporarily "forget" a PPD file if it
was updated in place.
- The dnssd backend now prefers IPPS over IPP.
diff --git a/CHANGES-IPPTOOL.txt b/CHANGES-IPPTOOL.txt
index 8d44270e9..d16bbd5dd 100644
--- a/CHANGES-IPPTOOL.txt
+++ b/CHANGES-IPPTOOL.txt
@@ -1,10 +1,21 @@
-CHANGES-IPPTOOL.txt - 2012-02-06
+CHANGES-IPPTOOL.txt - 2012-02-28
--------------------------------
This file provides a list of changes to the ipptool binary distribution posted
on cups.org.
+2012-02-28
+
+ - Changed behavior of WITH-VALUES "/regex/" to not require all values to
+ match.
+ - Added WITH-ALL-VALUES directive for EXPECT predicates that require all
+ values to match.
+ - Updated test files to use WITH-ALL-VALUES where necessary.
+ - Updated test files to use new ABNF for media names from PWG Media
+ Names 2.0.
+
+
2012-02-06
- Fixed the packaging of ipptool on Windows (removed unnecessary DLLs)
diff --git a/CHANGES.txt b/CHANGES.txt
index 0528f3c3d..658c462ff 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,9 +1,21 @@
-CHANGES.txt - 1.6b1 - 2012-02-15
+CHANGES.txt - 1.6b1 - 2012-03-16
--------------------------------
CHANGES IN CUPS V1.6b1
- Documentation updates (STR #3927, STR #3980, STR #4010)
+ - The PreserveJobFiles and PreserveJobHistory directives now support
+ specification of a time interval (STR #3143)
+ - PPD files can now be archived in (gzip'd) tar files to further reduce
+ the disk space used by PPD files (STR #3772)
+ - The network backends now deal with printers that report their levels
+ in percent but do not specify a maximum capacity of 100 (STR #3551)
+ - The network backends now report full/almost-full waste bins in
+ printers along with end-of-life for cleaning pads (STR #4017)
+ - Added a configure option to set the permissions of the installed
+ cupsd (STR #3459)
+ - Added a new WITH-ALL-VALUES directive to ipptool EXPECT predicates
+ (STR #3949)
- CUPS now supports a User directive in client.conf and the CUPS_USER
environment variable for overriding the default username (STR #3114)
- Now set the PJL USERNAME variable as needed (STR #3100)
diff --git a/Makedefs.in b/Makedefs.in
index 5db6b0ab7..9bf7afa85 100644
--- a/Makedefs.in
+++ b/Makedefs.in
@@ -42,6 +42,7 @@ SHELL = /bin/sh
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
+INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
INSTALL_DATA = $(INSTALL) -c -m 444
INSTALL_DIR = $(INSTALL) -d
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
@@ -62,6 +63,7 @@ CUPS_PRIMARY_SYSTEM_GROUP = @CUPS_PRIMARY_SYSTEM_GROUP@
#
CUPS_CONFIG_FILE_PERM = @CUPS_CONFIG_FILE_PERM@
+CUPS_CUPSD_FILE_PERM = @CUPS_CUPSD_FILE_PERM@
CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
#
diff --git a/backend/backend-private.h b/backend/backend-private.h
index e46973ad0..980b3e518 100644
--- a/backend/backend-private.h
+++ b/backend/backend-private.h
@@ -3,7 +3,7 @@
*
* Backend support definitions for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -259,6 +259,20 @@ extern "C" {
#define CUPS_TC_inserts 33
#define CUPS_TC_covers 34
+#define CUPS_TC_tenThousandthsOfInches 3
+#define CUPS_TC_micrometers 4
+#define CUPS_TC_impressions 7
+#define CUPS_TC_sheets 8
+#define CUPS_TC_hours 11
+#define CUPS_TC_thousandthsOfOunces 12
+#define CUPS_TC_tenthsOfGrams 13
+#define CUPS_TC_hundrethsOfFluidOunces 14
+#define CUPS_TC_tenthsOfMilliliters 15
+#define CUPS_TC_feet 16
+#define CUPS_TC_meters 17
+#define CUPS_TC_items 18
+#define CUPS_TC_percent 19
+
/* These come from RFC 3808 to define character sets we support */
/* Also see http://www.iana.org/assignments/character-sets */
#define CUPS_TC_csASCII 3
diff --git a/backend/dnssd.c b/backend/dnssd.c
index 12571b15c..35c44e30d 100644
--- a/backend/dnssd.c
+++ b/backend/dnssd.c
@@ -84,7 +84,8 @@ static void browse_callback(DNSServiceRef sdRef,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
- const char *replyDomain, void *context);
+ const char *replyDomain, void *context)
+ __attribute__((nonnull(1,5,6,7,8)));
static void browse_local_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -92,13 +93,15 @@ static void browse_local_callback(DNSServiceRef sdRef,
const char *serviceName,
const char *regtype,
const char *replyDomain,
- void *context);
+ void *context)
+ __attribute__((nonnull(1,5,6,7,8)));
static int compare_devices(cups_device_t *a, cups_device_t *b);
static void exec_backend(char **argv);
static cups_device_t *get_device(cups_array_t *devices,
const char *serviceName,
const char *regtype,
- const char *replyDomain);
+ const char *replyDomain)
+ __attribute__((nonnull(1,2,3,4)));
static void query_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -106,9 +109,11 @@ static void query_callback(DNSServiceRef sdRef,
const char *fullName, uint16_t rrtype,
uint16_t rrclass, uint16_t rdlen,
const void *rdata, uint32_t ttl,
- void *context);
+ void *context)
+ __attribute__((nonnull(1,5,9,11)));
static void sigterm_handler(int sig);
-static void unquote(char *dst, const char *src, size_t dstsize);
+static void unquote(char *dst, const char *src, size_t dstsize)
+ __attribute__((nonnull(1,2)));
/*
diff --git a/backend/ipp.c b/backend/ipp.c
index 20391f8a2..826d5b8a8 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -45,8 +45,12 @@
# define kPMPrintUIToolAgent "com.apple.printuitool.agent"
# define kPMStartJob 100
# define kPMWaitForJob 101
+# ifdef HAVE_XPC_PRIVATE_H
+# include
+# else
extern void xpc_connection_set_target_uid(xpc_connection_t connection,
uid_t uid);
+# endif /* HAVE_XPC_PRIVATE_H */
#endif /* HAVE_GSSAPI && HAVE_XPC */
@@ -1139,12 +1143,7 @@ main(int argc, /* I - Number of command-line args */
copies = atoi(argv[4]);
if (copies_sup || argc < 7)
- {
copies_remaining = 1;
-
- if (argc < 7 && !_cups_strncasecmp(final_content_type, "image/", 6))
- copies = 1;
- }
else
copies_remaining = copies;
@@ -1179,7 +1178,8 @@ main(int argc, /* I - Number of command-line args */
if (format_sup != NULL)
{
for (i = 0; i < format_sup->num_values; i ++)
- if (!_cups_strcasecmp(final_content_type, format_sup->values[i].string.text))
+ if (!_cups_strcasecmp(final_content_type,
+ format_sup->values[i].string.text))
{
document_format = final_content_type;
break;
@@ -1189,7 +1189,7 @@ main(int argc, /* I - Number of command-line args */
{
for (i = 0; i < format_sup->num_values; i ++)
if (!_cups_strcasecmp("application/octet-stream",
- format_sup->values[i].string.text))
+ format_sup->values[i].string.text))
{
document_format = "application/octet-stream";
break;
@@ -1197,6 +1197,9 @@ main(int argc, /* I - Number of command-line args */
}
}
+ fprintf(stderr, "DEBUG: final_content_type=\"%s\", document_format=\"%s\"\n",
+ final_content_type, document_format ? document_format : "(null)");
+
/*
* If the printer does not support HTTP/1.1 (which IPP requires), copy stdin
* to a temporary file so that we can do a HTTP/1.0 submission...
@@ -1552,8 +1555,9 @@ main(int argc, /* I - Number of command-line args */
if ((i + 1) >= num_files)
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
- "document-format", NULL, document_format);
+ if (document_format)
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
+ "document-format", NULL, document_format);
fprintf(stderr, "DEBUG: Sending file %d using chunking...\n", i + 1);
http_status = cupsSendRequest(http, request, resource, 0);
@@ -1578,10 +1582,11 @@ main(int argc, /* I - Number of command-line args */
if (fd >= 0)
{
- while (!job_canceled &&
+ while (!job_canceled && http_status == HTTP_CONTINUE &&
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
{
- if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
+ if ((http_status = cupsWriteRequestData(http, buffer, bytes))
+ != HTTP_CONTINUE)
break;
else
{
@@ -2446,9 +2451,46 @@ new_request(
NULL, "two-sided-short-edge");
}
- if (doc_handling_sup &&
- (!format || _cups_strncasecmp(format, "image/", 6)) &&
- (keyword = cupsGetOption("collate", num_options, options)) != NULL)
+ if ((keyword = cupsGetOption("multiple-document-handling",
+ num_options, options)) != NULL)
+ {
+ if (strstr(keyword, "uncollated"))
+ keyword = "false";
+ else
+ keyword = "true";
+ }
+ else if ((keyword = cupsGetOption("collate", num_options,
+ options)) == NULL)
+ keyword = "true";
+
+ if (format)
+ {
+ if (!_cups_strcasecmp(format, "image/gif") ||
+ !_cups_strcasecmp(format, "image/jp2") ||
+ !_cups_strcasecmp(format, "image/jpeg") ||
+ !_cups_strcasecmp(format, "image/png") ||
+ !_cups_strcasecmp(format, "image/tiff") ||
+ !_cups_strncasecmp(format, "image/x-", 8))
+ {
+ /*
+ * Collation makes no sense for single page image formats...
+ */
+
+ keyword = "false";
+ }
+ else if (!_cups_strncasecmp(format, "image/", 6) ||
+ !_cups_strcasecmp(format, "application/vnd.cups-raster"))
+ {
+ /*
+ * Multi-page image formats will have copies applied by the upstream
+ * filters...
+ */
+
+ copies = 1;
+ }
+ }
+
+ if (doc_handling_sup)
{
if (!_cups_strcasecmp(keyword, "true"))
collate_str = "separate-documents-collated-copies";
@@ -2513,7 +2555,7 @@ new_request(
cupsEncodeOptions(request, num_options, options);
}
- if (copies > 1 && copies <= pc->max_copies)
+ if (copies > 1 && (!pc || copies <= pc->max_copies))
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", copies);
}
diff --git a/backend/network.c b/backend/network.c
index 6dbdca03b..f011f2cf2 100644
--- a/backend/network.c
+++ b/backend/network.c
@@ -92,7 +92,7 @@ backendNetworkSideCB(
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
else if (backendDrainOutput(print_fd, device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
- else
+ else
status = CUPS_SC_STATUS_OK;
datalen = 0;
@@ -119,8 +119,35 @@ backendNetworkSideCB(
if (snmp_fd >= 0)
{
+ char *dataptr; /* Pointer into data */
cups_snmp_t packet; /* Packet from printer */
+ const char *snmp_value; /* CUPS_SNMP_VALUE env var */
+ if ((snmp_value = getenv("CUPS_SNMP_VALUE")) != NULL)
+ {
+ const char *snmp_count; /* CUPS_SNMP_COUNT env var */
+ int count; /* Repetition count */
+
+ if ((snmp_count = getenv("CUPS_SNMP_COUNT")) != NULL)
+ {
+ if ((count = atoi(snmp_count)) <= 0)
+ count = 1;
+ }
+ else
+ count = 1;
+
+ for (dataptr = data + strlen(data) + 1;
+ count > 0 && dataptr < (data + sizeof(data) - 1);
+ count --, dataptr += strlen(dataptr))
+ strlcpy(dataptr, snmp_value, sizeof(data) - (dataptr - data));
+
+ fprintf(stderr, "DEBUG: Returning %s %s\n", data,
+ data + strlen(data) + 1);
+
+ status = CUPS_SC_STATUS_OK;
+ datalen = dataptr - data;
+ break;
+ }
if (!_cupsSNMPStringToOID(data, packet.object_name, CUPS_SNMP_MAX_OID))
{
@@ -141,7 +168,6 @@ backendNetworkSideCB(
{
if (_cupsSNMPRead(snmp_fd, &packet, 1.0))
{
- char *dataptr; /* Pointer into data */
int i; /* Looping var */
@@ -172,7 +198,7 @@ backendNetworkSideCB(
case CUPS_ASN1_OCTET_STRING :
if (packet.object_value.string.num_bytes < 0)
i = 0;
- else if (packet.object_value.string.num_bytes <
+ else if (packet.object_value.string.num_bytes <
(sizeof(data) - (dataptr - data)))
i = packet.object_value.string.num_bytes;
else
diff --git a/backend/runloop.c b/backend/runloop.c
index 227883bfa..777b04801 100644
--- a/backend/runloop.c
+++ b/backend/runloop.c
@@ -3,7 +3,7 @@
*
* Common run loop APIs for CUPS backends.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -434,9 +434,11 @@ backendWaitLoop(
int use_bc, /* I - Use back-channel? */
_cups_sccb_t side_cb) /* I - Side-channel callback */
{
- fd_set input; /* Input set for reading */
- time_t curtime, /* Current time */
- snmp_update = 0; /* Last SNMP status update */
+ int nfds; /* Number of file descriptors */
+ fd_set input; /* Input set for reading */
+ time_t curtime = 0, /* Current time */
+ snmp_update = 0;/* Last SNMP status update */
+ struct timeval timeout; /* Timeout for select() */
fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
@@ -446,6 +448,9 @@ backendWaitLoop(
* Now loop until we receive data from stdin...
*/
+ if (snmp_fd >= 0)
+ snmp_update = time(NULL) + 5;
+
for (;;)
{
/*
@@ -457,7 +462,18 @@ backendWaitLoop(
if (side_cb)
FD_SET(CUPS_SC_FD, &input);
- if (select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL) < 0)
+ if (snmp_fd >= 0)
+ {
+ curtime = time(NULL);
+ timeout.tv_sec = curtime >= snmp_update ? 0 : snmp_update - curtime;
+ timeout.tv_usec = 0;
+
+ nfds = select(CUPS_SC_FD + 1, &input, NULL, NULL, &timeout);
+ }
+ else
+ nfds = select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL);
+
+ if (nfds < 0)
{
/*
* Pause printing to clear any pending errors...
@@ -501,10 +517,10 @@ backendWaitLoop(
* Do SNMP updates periodically...
*/
- if (snmp_fd >= 0 && time(&curtime) >= snmp_update)
+ if (snmp_fd >= 0 && curtime >= snmp_update)
{
if (backendSNMPSupplies(snmp_fd, addr, NULL, NULL))
- snmp_update = INT_MAX;
+ snmp_fd = -1;
else
snmp_update = curtime + 5;
}
diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c
index 0eaba065d..75dc9dc7a 100644
--- a/backend/snmp-supplies.c
+++ b/backend/snmp-supplies.c
@@ -36,14 +36,18 @@
#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer */
#define CUPS_SUPPLY_TIMEOUT 2.0 /* Timeout for SNMP lookups */
-#define CUPS_DEVELOPER_LOW 1
-#define CUPS_DEVELOPER_EMPTY 2
-#define CUPS_MARKER_SUPPLY_LOW 4
-#define CUPS_MARKER_SUPPLY_EMPTY 8
-#define CUPS_OPC_NEAR_EOL 16
-#define CUPS_OPC_LIFE_OVER 32
-#define CUPS_TONER_LOW 64
-#define CUPS_TONER_EMPTY 128
+#define CUPS_DEVELOPER_LOW 0x0001
+#define CUPS_DEVELOPER_EMPTY 0x0002
+#define CUPS_MARKER_SUPPLY_LOW 0x0004
+#define CUPS_MARKER_SUPPLY_EMPTY 0x0008
+#define CUPS_OPC_NEAR_EOL 0x0010
+#define CUPS_OPC_LIFE_OVER 0x0020
+#define CUPS_TONER_LOW 0x0040
+#define CUPS_TONER_EMPTY 0x0080
+#define CUPS_WASTE_ALMOST_FULL 0x0100
+#define CUPS_WASTE_FULL 0x0200
+#define CUPS_CLEANER_NEAR_EOL 0x0400 /* Proposed JPS3 */
+#define CUPS_CLEANER_LIFE_OVER 0x0800 /* Proposed JPS3 */
/*
@@ -146,6 +150,13 @@ static const int prtMarkerSuppliesType[] =
(sizeof(prtMarkerSuppliesType) /
sizeof(prtMarkerSuppliesType[0]));
/* Offset to supply index */
+static const int prtMarkerSuppliesSupplyUnit[] =
+ { CUPS_OID_prtMarkerSuppliesSupplyUnit, -1 },
+ /* Units OID */
+ prtMarkerSuppliesSupplyUnitOffset =
+ (sizeof(prtMarkerSuppliesSupplyUnit) /
+ sizeof(prtMarkerSuppliesSupplyUnit[0]));
+ /* Offset to supply index */
static const backend_state_t const printer_states[] =
{
@@ -173,7 +184,11 @@ static const backend_state_t const supply_states[] =
{ CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
{ CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
{ CUPS_TONER_LOW, "toner-low-report" },
- { CUPS_TONER_EMPTY, "toner-empty-warning" }
+ { CUPS_TONER_EMPTY, "toner-empty-warning" },
+ { CUPS_WASTE_ALMOST_FULL, "waste-receptacle-almost-full-report" },
+ { CUPS_WASTE_FULL, "waste-receptacle-full-warning" },
+ { CUPS_CLEANER_NEAR_EOL, "cleaner-life-almost-over-report" },
+ { CUPS_CLEANER_LIFE_OVER, "cleaner-life-over-warning" },
};
@@ -245,9 +260,6 @@ backendSNMPSupplies(
else
new_supply_state |= CUPS_TONER_LOW;
break;
- case CUPS_TC_wasteToner :
- case CUPS_TC_wasteInk :
- break;
case CUPS_TC_ink :
case CUPS_TC_inkCartridge :
case CUPS_TC_inkRibbon :
@@ -273,6 +285,23 @@ backendSNMPSupplies(
else
new_supply_state |= CUPS_OPC_NEAR_EOL;
break;
+ case CUPS_TC_wasteInk :
+ case CUPS_TC_wastePaper :
+ case CUPS_TC_wasteToner :
+ case CUPS_TC_wasteWater :
+ case CUPS_TC_wasteWax :
+ if (percent <= 1)
+ new_supply_state |= CUPS_WASTE_FULL;
+ else
+ new_supply_state |= CUPS_WASTE_ALMOST_FULL;
+ break;
+ case CUPS_TC_cleanerUnit :
+ case CUPS_TC_fuserCleaningPad :
+ if (percent <= 1)
+ new_supply_state |= CUPS_CLEANER_LIFE_OVER;
+ else
+ new_supply_state |= CUPS_CLEANER_NEAR_EOL;
+ break;
}
}
@@ -920,7 +949,9 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
if (i > num_supplies)
num_supplies = i;
- supplies[i - 1].max_capacity = packet->object_value.integer;
+ if (supplies[i - 1].max_capacity == 0 &&
+ packet->object_value.integer > 0)
+ supplies[i - 1].max_capacity = packet->object_value.integer;
}
else if (_cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesType))
{
@@ -941,6 +972,26 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
supplies[i - 1].type = packet->object_value.integer;
}
+ else if (_cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesSupplyUnit))
+ {
+ /*
+ * Get units for capacity...
+ */
+
+ i = packet->object_name[prtMarkerSuppliesSupplyUnitOffset];
+ if (i < 1 || i > CUPS_MAX_SUPPLIES ||
+ packet->object_type != CUPS_ASN1_INTEGER)
+ return;
+
+ fprintf(stderr, "DEBUG2: prtMarkerSuppliesSupplyUnit.1.%d = %d\n", i,
+ packet->object_value.integer);
+
+ if (i > num_supplies)
+ num_supplies = i;
+
+ if (packet->object_value.integer == CUPS_TC_percent)
+ supplies[i - 1].max_capacity = 100;
+ }
}
diff --git a/backend/testbackend.c b/backend/testbackend.c
index a3a7d97e6..454533f5d 100644
--- a/backend/testbackend.c
+++ b/backend/testbackend.c
@@ -573,13 +573,13 @@ main(int argc, /* I - Number of command-line args */
length = sizeof(buffer);
scstatus = cupsSideChannelSNMPGet(oid, buffer, &length, 5.0);
- printf("CUPS_SC_CMD_SNMP_GET %s returned %s, %s\n", oid,
- statuses[scstatus], buffer);
+ printf("CUPS_SC_CMD_SNMP_GET %s returned %s, %d bytes (%s)\n", oid,
+ statuses[scstatus], (int)length, buffer);
length = sizeof(buffer);
scstatus = cupsSideChannelSNMPGet(oid, buffer, &length, 5.0);
- printf("CUPS_SC_CMD_SNMP_GET %s returned %s, %s\n", oid,
- statuses[scstatus], buffer);
+ printf("CUPS_SC_CMD_SNMP_GET %s returned %s, %d bytes (%s)\n", oid,
+ statuses[scstatus], (int)length, buffer);
}
length = 0;
@@ -638,13 +638,13 @@ sigterm_handler(int sig) /* I - Signal */
static void
usage(void)
{
- puts("Usage: testbackend [-cancel] [-d] [-ps | -pcl] [-s [-oid OID] "
+ puts("Usage: testbackend [-cancel] [-d] [-ps | -pcl] [-s [-get OID] "
"[-walk OID]] [-t] device-uri job-id user title copies options [file]");
puts("");
puts("Options:");
puts(" -cancel Simulate a canceled print job after 2 seconds.");
puts(" -d Show log messages from backend.");
- puts(" -oid OID Lookup the specified SNMP OID.");
+ puts(" -get OID Lookup the specified SNMP OID.");
puts(" (.1.3.6.1.2.1.43.10.2.1.4.1.1 is a good one for printers)");
puts(" -pcl Send PCL+PJL query and test page to backend.");
puts(" -ps Send PostScript query and test page to backend.");
@@ -667,7 +667,7 @@ walk_cb(const char *oid, /* I - OID */
int datalen, /* I - Length of data */
void *context) /* I - Context (unused) */
{
- printf("CUPS_SC_CMD_SNMP_WALK %s=%s (%d bytes)\n", oid, data, datalen);
+ printf("CUPS_SC_CMD_SNMP_WALK %s, %d bytes (%s)\n", oid, datalen, data);
}
diff --git a/berkeley/lpc.c b/berkeley/lpc.c
index 36d08bd68..e1003b1b1 100644
--- a/berkeley/lpc.c
+++ b/berkeley/lpc.c
@@ -3,7 +3,7 @@
*
* "lpc" command for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -364,7 +364,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
for (ptr = printer;
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
- ptr ++, dptr ++);
+ ptr ++, dptr ++)
+ /* do nothing */;
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
isspace(*dptr & 255)))
diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index 64a29bffd..dcfc2dc47 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -1557,6 +1557,8 @@ do_config_server(http_t *http) /* I - HTTP connection */
int advanced, /* Advanced settings shown? */
changed; /* Have settings changed? */
const char *debug_logging, /* DEBUG_LOGGING value */
+ *preserve_jobs = NULL,
+ /* PRESERVE_JOBS value */
*remote_admin, /* REMOTE_ADMIN value */
*remote_any, /* REMOTE_ANY value */
*share_printers,/* SHARE_PRINTERS value */
@@ -1611,19 +1613,36 @@ do_config_server(http_t *http) /* I - HTTP connection */
*/
browse_web_if = cgiGetVariable("BROWSE_WEB_IF") ? "Yes" : "No";
- preserve_job_history = cgiGetVariable("PRESERVE_JOB_HISTORY") ? "Yes" : "No";
- preserve_job_files = cgiGetVariable("PRESERVE_JOB_FILES") ? "Yes" : "No";
max_clients = cgiGetVariable("MAX_CLIENTS");
- max_jobs = cgiGetVariable("MAX_JOBS");
max_log_size = cgiGetVariable("MAX_LOG_SIZE");
+ preserve_jobs = cgiGetVariable("PRESERVE_JOBS");
+
+ if (preserve_jobs)
+ {
+ max_jobs = cgiGetVariable("MAX_JOBS");
+ preserve_job_history = cgiGetVariable("PRESERVE_JOB_HISTORY");
+ preserve_job_files = cgiGetVariable("PRESERVE_JOB_FILES");
+
+ if (!max_jobs || atoi(max_jobs) < 0)
+ max_jobs = "500";
+
+ if (!preserve_job_history)
+ preserve_job_history = "On";
+
+ if (!preserve_job_files)
+ preserve_job_files = "1d";
+ }
+ else
+ {
+ max_jobs = "0";
+ preserve_job_history = "No";
+ preserve_job_files = "No";
+ }
if (!max_clients || atoi(max_clients) <= 0)
max_clients = "100";
- if (!max_jobs || atoi(max_jobs) <= 0)
- max_jobs = "500";
-
- if (!max_log_size || atof(max_log_size) <= 0.0)
+ if (!max_log_size || atoi(max_log_size) <= 0.0)
max_log_size = "1m";
}
@@ -1674,7 +1693,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
if ((current_preserve_job_files = cupsGetOption("PreserveJobFiles",
num_settings,
settings)) == NULL)
- current_preserve_job_files = "No";
+ current_preserve_job_files = "1d";
if ((current_max_clients = cupsGetOption("MaxClients", num_settings,
settings)) == NULL)
@@ -2636,18 +2655,25 @@ do_menu(http_t *http) /* I - HTTP connection */
settings)) == NULL)
val = "Yes";
- if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") ||
- !_cups_strcasecmp(val, "true"))
+ if (val &&
+ (!_cups_strcasecmp(val, "0") || !_cups_strcasecmp(val, "no") ||
+ !_cups_strcasecmp(val, "off") || !_cups_strcasecmp(val, "false") ||
+ !_cups_strcasecmp(val, "disabled")))
{
- cgiSetVariable("PRESERVE_JOB_HISTORY", "CHECKED");
+ cgiSetVariable("PRESERVE_JOB_HISTORY", "0");
+ cgiSetVariable("PRESERVE_JOB_FILES", "0");
+ }
+ else
+ {
+ cgiSetVariable("PRESERVE_JOBS", "CHECKED");
+ cgiSetVariable("PRESERVE_JOB_HISTORY", val);
if ((val = cupsGetOption("PreserveJobFiles", num_settings,
settings)) == NULL)
- val = "No";
+ val = "1d";
+
+ cgiSetVariable("PRESERVE_JOB_FILES", val);
- if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") ||
- !_cups_strcasecmp(val, "true"))
- cgiSetVariable("PRESERVE_JOB_FILES", "CHECKED");
}
if ((val = cupsGetOption("MaxClients", num_settings, settings)) == NULL)
diff --git a/cgi-bin/help.c b/cgi-bin/help.c
index 32b6db693..215c98bc4 100644
--- a/cgi-bin/help.c
+++ b/cgi-bin/help.c
@@ -39,7 +39,8 @@ main(int argc, /* I - Number of command-line arguments */
const char *query; /* Search query */
const char *cache_dir; /* CUPS_CACHEDIR environment variable */
const char *docroot; /* CUPS_DOCROOT environment variable */
- const char *helpfile; /* Current help file */
+ const char *helpfile, /* Current help file */
+ *helptitle = NULL; /* Current help title */
const char *topic; /* Current topic */
char topic_data[1024]; /* Topic form data */
const char *section; /* Current section */
@@ -88,7 +89,7 @@ main(int argc, /* I - Number of command-line arguments */
perror(filename);
cgiStartHTML(cgiText(_("Online Help")));
- cgiSetVariable("ERROR", "Unable to load help index!");
+ cgiSetVariable("ERROR", cgiText(_("Unable to load help index.")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -129,7 +130,7 @@ main(int argc, /* I - Number of command-line arguments */
perror(filename);
cgiStartHTML(cgiText(_("Online Help")));
- cgiSetVariable("ERROR", "Unable to access help file!");
+ cgiSetVariable("ERROR", cgiText(_("Unable to access help file.")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -139,7 +140,7 @@ main(int argc, /* I - Number of command-line arguments */
if ((n = helpFindNode(hi, helpfile, NULL)) == NULL)
{
cgiStartHTML(cgiText(_("Online Help")));
- cgiSetVariable("ERROR", "Help file not in index!");
+ cgiSetVariable("ERROR", cgiText(_("Help file not in index.")));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
@@ -147,12 +148,11 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
- * Set the page title and save the help file...
+ * Save the page title and help file...
*/
- cgiSetVariable("HELPFILE", helpfile);
- cgiSetVariable("HELPTITLE", n->text);
- cgiSetVariable("TOPIC", n->section);
+ helptitle = n->text;
+ topic = n->section;
/*
* Send a standard page header...
@@ -170,6 +170,8 @@ main(int argc, /* I - Number of command-line arguments */
*/
cgiStartHTML(cgiText(_("Online Help")));
+
+ topic = cgiGetVariable("TOPIC");
}
/*
@@ -180,7 +182,6 @@ main(int argc, /* I - Number of command-line arguments */
cgiSetVariable("QUERY", "");
query = cgiGetVariable("QUERY");
- topic = cgiGetVariable("TOPIC");
si = helpSearchIndex(hi, query, topic, helpfile);
cgiClearVariables();
@@ -188,6 +189,10 @@ main(int argc, /* I - Number of command-line arguments */
cgiSetVariable("QUERY", query);
if (topic)
cgiSetVariable("TOPIC", topic);
+ if (helpfile)
+ cgiSetVariable("HELPFILE", helpfile);
+ if (helptitle)
+ cgiSetVariable("HELPTITLE", helptitle);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n",
query ? query : "(null)", topic ? topic : "(null)");
@@ -356,7 +361,7 @@ main(int argc, /* I - Number of command-line arguments */
else
{
perror(filename);
- cgiSetVariable("ERROR", "Unable to open help file.");
+ cgiSetVariable("ERROR", cgiText(_("Unable to open help file.")));
cgiCopyTemplateLang("error.tmpl");
}
}
diff --git a/cgi-bin/var.c b/cgi-bin/var.c
index d5e58eb1e..8b8c026c4 100644
--- a/cgi-bin/var.c
+++ b/cgi-bin/var.c
@@ -167,6 +167,8 @@ cgiClearVariables(void)
_cgi_var_t *v; /* Current variable */
+ fputs("DEBUG: cgiClearVariables called.\n", stderr);
+
for (v = form_vars, i = form_count; i > 0; v ++, i --)
{
_cupsStrFree(v->name);
@@ -401,6 +403,8 @@ cgiSetArray(const char *name, /* I - Name of variable */
if (name == NULL || value == NULL || element < 0 || element > 100000)
return;
+ fprintf(stderr, "DEBUG: cgiSetArray: %s[%d]=\"%s\"\n", name, element, value);
+
if ((var = cgi_find_variable(name)) == NULL)
{
cgi_add_variable(name, element, value);
@@ -532,6 +536,8 @@ cgiSetVariable(const char *name, /* I - Name of variable */
if (name == NULL || value == NULL)
return;
+ fprintf(stderr, "cgiSetVariable: %s=\"%s\"\n", name, value);
+
if ((var = cgi_find_variable(name)) == NULL)
{
cgi_add_variable(name, 0, value);
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index 9b8ac80aa..592e253bb 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -3,7 +3,7 @@ dnl "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $"
dnl
dnl Common configuration stuff for CUPS.
dnl
-dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -50,6 +50,7 @@ AC_PROG_CXX
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
+AC_PATH_PROG(GZIP,gzip)
AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
@@ -237,7 +238,7 @@ if test "x$PKGCONFIG" != x; then
AC_MSG_RESULT(no)
fi
fi
-elif x$enable_libusb = xyes; then
+elif test x$enable_libusb = xyes; then
AC_MSG_ERROR(Need pkg-config to enable libusb support.)
fi
@@ -255,12 +256,17 @@ if test x$enable_tcp_wrappers = xyes; then
fi
dnl ZLIB
+INSTALL_GZIP=""
LIBZ=""
AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, gzgets,
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
- LIBS="$LIBS -lz"))
+ LIBS="$LIBS -lz"
+ if test "x$GZIP" != z; then
+ INSTALL_GZIP="-z"
+ fi))
+AC_SUBST(INSTALL_GZIP)
AC_SUBST(LIBZ)
dnl Flags for "ar" command...
@@ -411,6 +417,8 @@ case $uname in
AC_CHECK_HEADER(xpc/xpc.h,
AC_DEFINE(HAVE_XPC)
INSTALLXPC="install-xpc")
+ AC_CHECK_HEADER(xpc/private.h,
+ AC_DEFINE(HAVE_XPC_PRIVATE_H))
;;
esac
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index c223d8db0..69699fb85 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -3,7 +3,7 @@ dnl "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $"
dnl
dnl Default cupsd configuration settings for CUPS.
dnl
-dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -14,7 +14,7 @@ dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Default languages...
-LANGUAGES="`ls -1 locale/cups_*.po | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
+LANGUAGES="`ls -1 locale/cups_*.po 2>/dev/null | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
AC_ARG_WITH(languages, [ --with-languages set installed languages, default=all ],[
case "$withval" in
@@ -25,7 +25,7 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
AC_SUBST(LANGUAGES)
dnl Mac OS X bundle-based localization support
-AC_ARG_WITH(bundledir, [ --with-bundledir set Mac OS X localization bundle directory ],
+AC_ARG_WITH(bundledir, [ --with-bundledir set Mac OS X localization bundle directory ],
CUPS_BUNDLEDIR="$withval",
if test "x$uname" = xDarwin -a $uversion -ge 100; then
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
@@ -50,6 +50,12 @@ AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFileP
AC_SUBST(CUPS_CONFIG_FILE_PERM)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
+dnl Default permissions for cupsd
+AC_ARG_WITH(cupsd_file_perm, [ --with-cupsd-file-perm set default cupsd permissions, default=0500],
+ CUPS_CUPSD_FILE_PERM="$withval",
+ CUPS_CUPSD_FILE_PERM="500")
+AC_SUBST(CUPS_CUPSD_FILE_PERM)
+
dnl Default LogFilePerm
AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
CUPS_LOG_FILE_PERM="$withval",
diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4
index 48012d926..157ed0f42 100644
--- a/config-scripts/cups-ssl.m4
+++ b/config-scripts/cups-ssl.m4
@@ -3,7 +3,7 @@ dnl "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for CUPS.
dnl
-dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -136,9 +136,9 @@ if test x$enable_ssl != xno; then
dnl case the RSAREF libraries are needed.
for libcrypto in \
- "-lcrypto" \
- "-lcrypto -lrsaref" \
- "-lcrypto -lRSAglue -lrsaref"
+ "-lcrypto" \
+ "-lcrypto -lrsaref" \
+ "-lcrypto -lRSAglue -lrsaref"
do
AC_CHECK_LIB(ssl,SSL_new,
[have_ssl=1
@@ -149,6 +149,9 @@ if test x$enable_ssl != xno; then
$libcrypto)
if test "x${SSLLIBS}" != "x"; then
+ LIBS="$SAVELIBS $SSLLIBS"
+ AC_CHECK_FUNC(SSL_set_tlsext_host_name,
+ AC_DEFINE(HAVE_SSL_SET_TLSEXT_HOST_NAME))
break
fi
done
@@ -173,7 +176,6 @@ AC_SUBST(SSLLIBS)
EXPORT_SSLLIBS="$SSLLIBS"
AC_SUBST(EXPORT_SSLLIBS)
-
dnl
dnl End of "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $".
dnl
diff --git a/config-scripts/cups-ssl.m4.orig b/config-scripts/cups-ssl.m4.orig
new file mode 100644
index 000000000..48012d926
--- /dev/null
+++ b/config-scripts/cups-ssl.m4.orig
@@ -0,0 +1,179 @@
+dnl
+dnl "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $"
+dnl
+dnl OpenSSL/GNUTLS stuff for CUPS.
+dnl
+dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
+dnl
+dnl These coded instructions, statements, and computer programs are the
+dnl property of Apple Inc. and are protected by Federal copyright
+dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
+dnl which should have been included with this file. If this file is
+dnl file is missing or damaged, see the license at "http://www.cups.org/".
+dnl
+
+AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support])
+AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first])
+AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second])
+AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=third])
+AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
+ LDFLAGS="-L$withval $LDFLAGS"
+ DSOFLAGS="-L$withval $DSOFLAGS",)
+AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
+ CFLAGS="-I$withval $CFLAGS"
+ CPPFLAGS="-I$withval $CPPFLAGS",)
+
+SSLFLAGS=""
+SSLLIBS=""
+have_ssl=0
+
+if test x$enable_ssl != xno; then
+ dnl Look for CDSA...
+ if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
+ if test $uname = Darwin; then
+ AC_CHECK_HEADER(Security/SecureTransport.h, [
+ have_ssl=1
+ AC_DEFINE(HAVE_SSL)
+ AC_DEFINE(HAVE_CDSASSL)
+
+ dnl Check for the various security headers...
+ AC_CHECK_HEADER(Security/SecureTransportPriv.h,
+ AC_DEFINE(HAVE_SECURETRANSPORTPRIV_H))
+ AC_CHECK_HEADER(Security/SecCertificate.h,
+ AC_DEFINE(HAVE_SECCERTIFICATE_H))
+ AC_CHECK_HEADER(Security/SecItem.h,
+ AC_DEFINE(HAVE_SECITEM_H))
+ AC_CHECK_HEADER(Security/SecItemPriv.h,
+ AC_DEFINE(HAVE_SECITEMPRIV_H),,
+ [#include ])
+ AC_CHECK_HEADER(Security/SecPolicy.h,
+ AC_DEFINE(HAVE_SECPOLICY_H))
+ AC_CHECK_HEADER(Security/SecPolicyPriv.h,
+ AC_DEFINE(HAVE_SECPOLICYPRIV_H))
+ AC_CHECK_HEADER(Security/SecBasePriv.h,
+ AC_DEFINE(HAVE_SECBASEPRIV_H))
+ AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
+ AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
+
+ dnl Check for SSLSetProtocolVersionMax...
+ SAVELIBS="$LIBS"
+ LIBS="$LIBS -framework Security"
+ AC_CHECK_FUNC(SSLSetProtocolVersionMax)
+ LIBS="$SAVELIBS"
+
+ dnl Check for SecCertificateCopyData..
+ AC_MSG_CHECKING(for SecCertificateCopyData)
+ if test $uversion -ge 100; then
+ AC_DEFINE(HAVE_SECCERTIFICATECOPYDATA)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ dnl Check for SecIdentitySearchCreateWithPolicy...
+ AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
+ if test $uversion -ge 80; then
+ AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ dnl Check for SecPolicyCreateSSL...
+ AC_MSG_CHECKING(for SecPolicyCreateSSL)
+ if test $uversion -ge 110; then
+ AC_DEFINE(HAVE_SECPOLICYCREATESSL)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi])
+
+ AC_DEFINE(HAVE_CSSMERRORSTRING)
+ fi
+ fi
+
+ dnl Then look for GNU TLS...
+ if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
+ AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
+ AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
+ if $PKGCONFIG --exists gnutls; then
+ have_ssl=1
+ SSLLIBS=`$PKGCONFIG --libs gnutls`
+ SSLFLAGS=`$PKGCONFIG --cflags gnutls`
+ AC_DEFINE(HAVE_SSL)
+ AC_DEFINE(HAVE_GNUTLS)
+ elif test "x$LIBGNUTLSCONFIG" != x; then
+ have_ssl=1
+ SSLLIBS=`$LIBGNUTLSCONFIG --libs`
+ SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
+ AC_DEFINE(HAVE_SSL)
+ AC_DEFINE(HAVE_GNUTLS)
+ fi
+
+ if test $have_ssl = 1; then
+ if $PKGCONFIG --exists gcrypt; then
+ SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
+ SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
+ elif test "x$LIBGCRYPTCONFIG" != x; then
+ SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`"
+ SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`"
+ fi
+ fi
+ fi
+
+ dnl Check for the OpenSSL library last...
+ if test $have_ssl = 0 -a "x$enable_openssl" != "xno"; then
+ AC_CHECK_HEADER(openssl/ssl.h,
+ dnl Save the current libraries so the crypto stuff isn't always
+ dnl included...
+ SAVELIBS="$LIBS"
+
+ dnl Some ELF systems can't resolve all the symbols in libcrypto
+ dnl if libcrypto was linked against RSAREF, and fail to link the
+ dnl test program correctly, even though a correct installation
+ dnl of OpenSSL exists. So we test the linking three times in
+ dnl case the RSAREF libraries are needed.
+
+ for libcrypto in \
+ "-lcrypto" \
+ "-lcrypto -lrsaref" \
+ "-lcrypto -lRSAglue -lrsaref"
+ do
+ AC_CHECK_LIB(ssl,SSL_new,
+ [have_ssl=1
+ SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
+ SSLLIBS="-lssl $libcrypto"
+ AC_DEFINE(HAVE_SSL)
+ AC_DEFINE(HAVE_LIBSSL)],,
+ $libcrypto)
+
+ if test "x${SSLLIBS}" != "x"; then
+ break
+ fi
+ done
+
+ LIBS="$SAVELIBS")
+ fi
+fi
+
+IPPALIASES="http"
+if test $have_ssl = 1; then
+ AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
+ AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
+ IPPALIASES="http https ipps"
+elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = xyes; then
+ AC_MSG_ERROR([Unable to enable SSL support.])
+fi
+
+AC_SUBST(IPPALIASES)
+AC_SUBST(SSLFLAGS)
+AC_SUBST(SSLLIBS)
+
+EXPORT_SSLLIBS="$SSLLIBS"
+AC_SUBST(EXPORT_SSLLIBS)
+
+
+dnl
+dnl End of "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $".
+dnl
diff --git a/config.h.in b/config.h.in
index 9c1faf9ab..4081f7db8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -295,6 +295,13 @@
#undef HAVE_SSL
+/*
+ * Do we have the SSL_set_tlsext_host_name function?
+ */
+
+#undef HAVE_SSL_SET_TLSEXT_HOST_NAME
+
+
/*
* What Security framework headers do we have?
*/
@@ -735,6 +742,7 @@
*/
#undef HAVE_XPC
+#undef HAVE_XPC_PRIVATE_H
/*
diff --git a/cups/api-httpipp.shtml b/cups/api-httpipp.shtml
index d90d847d8..cd0fd53b5 100644
--- a/cups/api-httpipp.shtml
+++ b/cups/api-httpipp.shtml
@@ -3,7 +3,7 @@
HTTP and IPP API introduction for CUPS.
- Copyright 2007-2011 by Apple Inc.
+ Copyright 2007-2012 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -29,35 +29,20 @@ The constant CUPS_HTTP_DEFAULT
can be used with all of the
cups
functions to refer to the default CUPS server - the functions
create a per-thread http_t
as needed.
-The IPP APIs use two structures for requests (messages sent to the CUPS
-scheduler) and responses (messages sent back to your application from the
-scheduler). The ipp_t
structure holds a
-complete request or response and is allocated using the
-ippNew
or
-ippNewRequest
functions and
-freed using the ippDelete
function.
-
-The second structure is called
-ipp_attribute_t
and holds a
-single IPP attribute which consists of a group tag (group_tag
), a
-value type tag (value_tag
), the attribute name (name
),
-and 1 or more values (values[]
). Attributes are added to an
-ipp_t
structure using one of the
-ippAdd
functions. For example, use
-ippAddString
to add a
-"requesting-user-name" string attribute to a request:
+The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The ipp_t
type holds a complete request or response and is allocated using the ippNew
or ippNewRequest
functions and freed using the ippDelete
function.
+
+The second opaque structure is called ipp_attribute_t
and holds a single IPP attribute which consists of a group tag (ippGetGroupTag
), a value type tag (ippGetValueTag
), the attribute name (ippGetName
), and 1 or more values (ippGetCount
, ippGetBoolean
, ippGetCollection
, ippGetDate
, ippGetInteger
, ippGetRange
, ippGetResolution
, and ippGetString
). Attributes are added to an ipp_t
pointer using one of the ippAdd
functions. For example, use ippAddString
to add the "printer-uri" and "requesting-user-name" string attributes to a request:
ipp_t *request = ippNewRequest(IPP_GET_JOBS);
+ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, "ipp://localhost/printers/");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
-Once you have created an IPP request, use the cups
-functions to send the request to and read the response from the server.
-For example, the cupsDoRequest
-function can be used for simple query operations that do not involve files:
+Once you have created an IPP request, use the cups
functions to send the request to and read the response from the server. For example, the cupsDoRequest
function can be used for simple query operations that do not involve files:
#include <cups/cups.h>
@@ -67,6 +52,8 @@ function can be used for simple query operations that do not involve files:
{
ipp_t *request = ippNewRequest(IPP_GET_JOBS);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, "ipp://localhost/printers/");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
@@ -74,13 +61,7 @@ function can be used for simple query operations that do not involve files:
}
-The cupsDoRequest
function frees
-the request structure and returns an IPP response structure or NULL pointer if
-the request could not be sent to the server. Once you have a response from
-the server, you can either use the
-ippFindAttribute
and
-ippFindNextAttribute
functions
-to find specific attributes, for example:
+The cupsDoRequest
function frees the request and returns an IPP response or NULL
pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the ippFindAttribute
and ippFindNextAttribute
functions to find specific attributes, for example:
ipp_t *response;
@@ -89,25 +70,20 @@ to find specific attributes, for example:
attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM);
-You can also walk the list of attributes with a simple for
loop
-like this:
+You can also walk the list of attributes with a simple for
loop like this:
ipp_t *response;
ipp_attribute_t *attr;
-for (attr = response->attrs; attr != NULL; attr = attr->next)
- if (attr->name == NULL)
+for (attr = ippFirstAttribute(response); attr != NULL; attr = ippNextAttribute(response))
+ if (ippGetName(attr) == NULL)
puts("--SEPARATOR--");
else
- puts(attr->name);
+ puts(ippGetName(attr));
-The for
loop approach is normally used when collecting
-attributes for multiple objects (jobs, printers, etc.) in a response. Attributes
-with NULL
names indicate a separator between the attributes of
-each object. For example, the following code will list the jobs returned from
-our previous get_jobs
example code:
+The for
loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with NULL
names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous get_jobs
example code:
ipp_t *response = get_jobs();
@@ -115,37 +91,55 @@ our previous get_jobs
example code:
if (response != NULL)
{
ipp_attribute_t *attr;
+ const char *attrname;
int job_id = 0;
- char *job_name = NULL;
- char *job_originating_user_name = NULL;
+ const char *job_name = NULL;
+ const char *job_originating_user_name = NULL;
puts("Job ID Owner Title");
puts("------ ---------------- ---------------------------------");
- for (attr = response->attrs; attr != NULL; attr = attr->next)
+ for (attr = ippFirstAttribute(response); attr != NULL; attr = ippNextAttribute(response))
{
/* Attributes without names are separators between jobs */
- if (attr->name == NULL)
+ attrname = ippGetName(attr);
+ if (attrname == NULL)
{
- if (job_id > 0 && job_name != NULL && job_originating_user_name != NULL)
+ if (job_id > 0)
+ {
+ if (job_name == NULL)
+ job_name = "(withheld)";
+
+ if (job_originating_user_name == NULL)
+ job_originating_user_name = "(withheld)";
+
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
+ }
job_id = 0;
job_name = NULL;
job_originating_user_name = NULL;
continue;
}
- else if (!strcmp(attr->name, "job-id") && attr->value_tag == IPP_TAG_INTEGER)
- job_id = attr->values[0].integer;
- else if (!strcmp(attr->name, "job-name") && attr->value_tag == IPP_TAG_NAME)
- job_name = attr->values[0].string.text;
- else if (!strcmp(attr->name, "job-originating-user-name") &&
- attr->value_tag == IPP_TAG_NAME)
- job_originating_user_name = attr->values[0].string.text;
+ else if (!strcmp(attrname, "job-id") && ippGetValueTag(attr) == IPP_TAG_INTEGER)
+ job_id = ippGetInteger(attr, 0);
+ else if (!strcmp(attrname, "job-name") && ippGetValueTag(attr) == IPP_TAG_NAME)
+ job_name = ippGetString(attr, 0, NULL);
+ else if (!strcmp(attrname, "job-originating-user-name") &&
+ ippGetValueTag(attr) == IPP_TAG_NAME)
+ job_originating_user_name = ippGetString(attr, 0, NULL);
}
- if (job_id > 0 && job_name != NULL && job_originating_user_name != NULL)
+ if (job_id > 0)
+ {
+ if (job_name == NULL)
+ job_name = "(withheld)";
+
+ if (job_originating_user_name == NULL)
+ job_originating_user_name = "(withheld)";
+
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
+ }
}
diff --git a/cups/cups-private.h b/cups/cups-private.h
index e2ae33741..e2c0239ad 100644
--- a/cups/cups-private.h
+++ b/cups/cups-private.h
@@ -22,15 +22,15 @@
* Include necessary headers...
*/
-# include
# include "string-private.h"
# include "debug-private.h"
-# include "ppd-private.h"
-# include "http-private.h"
# include "ipp-private.h"
+# include "http-private.h"
# include "language-private.h"
# include "pwg-private.h"
+# include "ppd-private.h"
# include "thread-private.h"
+# include
# ifdef __APPLE__
# include
# include
diff --git a/cups/cups.h b/cups/cups.h
index 685e54452..7425ce16e 100644
--- a/cups/cups.h
+++ b/cups/cups.h
@@ -513,7 +513,8 @@ extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
const char *option,
const char *value) _CUPS_API_1_6;
extern ipp_status_t cupsCloseDestJob(http_t *http, cups_dest_t *dest,
- int job_id) _CUPS_API_1_6;
+ cups_dinfo_t *info, int job_id)
+ _CUPS_API_1_6;
extern http_t *cupsConnectDest(cups_dest_t *dest, unsigned flags,
int msec, int *cancel,
char *resource, size_t resourcesize,
@@ -558,7 +559,9 @@ extern int cupsEnumDestsBlock(unsigned flags, int msec,
_CUPS_API_1_6;
# endif /* __BLOCKS__ */
extern ipp_status_t cupsFinishDestDocument(http_t *http,
- cups_dest_t *dest) _CUPS_API_1_6;
+ cups_dest_t *dest,
+ cups_dinfo_t *info)
+ _CUPS_API_1_6;
extern void cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6;
extern int cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo,
diff --git a/cups/dest-job.c b/cups/dest-job.c
index 31cac7903..01f8578e0 100644
--- a/cups/dest-job.c
+++ b/cups/dest-job.c
@@ -53,27 +53,92 @@ cupsCancelDestJob(http_t *http, /* I - Connection to destination */
* 'cupsCloseDestJob()' - Close a job and start printing.
*
* Use when the last call to cupsStartDocument passed 0 for "last_document".
- * "job_id" is the job ID returned by cupsCreateDestJob. Returns IPP_OK on
- * success.
+ * "job_id" is the job ID returned by cupsCreateDestJob. Returns @code IPP_OK@
+ * on success.
*
* @since CUPS 1.6@
*/
-ipp_status_t
+ipp_status_t /* O - IPP status code */
cupsCloseDestJob(
- http_t *http, /* I - Connection to destination */
- cups_dest_t *dest, /* I - Destination */
- int job_id) /* I - Job ID */
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *info, /* I - Destination information */
+ int job_id) /* I - Job ID */
{
- return (IPP_NOT_FOUND);
+ int i; /* Looping var */
+ ipp_t *request = NULL;/* Close-Job/Send-Document request */
+ ipp_attribute_t *attr; /* operations-supported attribute */
+
+
+ DEBUG_printf(("cupsCloseDestJob(http=%p, dest=%p(%s/%s), info=%p, job_id=%d)",
+ http, dest, dest ? dest->name : NULL,
+ dest ? dest->instance : NULL, info, job_id));
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !info || job_id <= 0)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+ DEBUG_puts("1cupsCloseDestJob: Bad arguments.");
+ return (IPP_INTERNAL_ERROR);
+ }
+
+ /*
+ * Build a Close-Job or empty Send-Document request...
+ */
+
+ if ((attr = ippFindAttribute(info->attrs, "operations-supported",
+ IPP_TAG_ENUM)) != NULL)
+ {
+ for (i = 0; i < attr->num_values; i ++)
+ if (attr->values[i].integer == IPP_CLOSE_JOB)
+ {
+ request = ippNewRequest(IPP_CLOSE_JOB);
+ break;
+ }
+ }
+
+ if (!request)
+ request = ippNewRequest(IPP_SEND_DOCUMENT);
+
+ if (!request)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+ DEBUG_puts("1cupsCloseDestJob: Unable to create Close-Job/Send-Document "
+ "request.");
+ return (IPP_INTERNAL_ERROR);
+ }
+
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, info->uri);
+ ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
+ job_id);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
+ NULL, cupsUser());
+ if (ippGetOperation(request) == IPP_SEND_DOCUMENT)
+ ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
+
+ /*
+ * Send the request and return the status...
+ */
+
+ ippDelete(cupsDoRequest(http, request, info->resource));
+
+ DEBUG_printf(("1cupsCloseDestJob: %s (%s)", ippErrorString(cupsLastError()),
+ cupsLastErrorString()));
+
+ return (cupsLastError());
}
/*
* 'cupsCreateDestJob()' - Create a job on a destination.
*
- * Returns IPP_OK or IPP_OK_SUBST on success, saving the job ID in the variable
- * pointed to by "job_id".
+ * Returns @code IPP_OK@ or @code IPP_OK_SUBST@ on success, saving the job ID
+ * in the variable pointed to by "job_id".
*
* @since CUPS 1.6@
*/
@@ -88,26 +153,115 @@ cupsCreateDestJob(
int num_options, /* I - Number of job options */
cups_option_t *options) /* I - Job options */
{
- *job_id = 0;
+ ipp_t *request, /* Create-Job request */
+ *response; /* Create-Job response */
+ ipp_attribute_t *attr; /* job-id attribute */
+
+
+ DEBUG_printf(("cupsCreateDestJob(http=%p, dest=%p(%s/%s), info=%p, "
+ "job_id=%p, title=\"%s\", num_options=%d, options=%p)",
+ http, dest, dest ? dest->name : NULL,
+ dest ? dest->instance : NULL, info, job_id, title, num_options,
+ options));
+
+ /*
+ * Range check input...
+ */
+
+ if (job_id)
+ *job_id = 0;
+
+ if (!http || !dest || !info || !job_id)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+ DEBUG_puts("1cupsCreateDestJob: Bad arguments.");
+ return (IPP_INTERNAL_ERROR);
+ }
+
+ /*
+ * Build a Create-Job request...
+ */
+
+ if ((request = ippNewRequest(IPP_CREATE_JOB)) == NULL)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+ DEBUG_puts("1cupsCreateDestJob: Unable to create Create-Job request.");
+ return (IPP_INTERNAL_ERROR);
+ }
+
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, info->uri);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
+ NULL, cupsUser());
+ if (title)
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
+ title);
+ cupsEncodeOptions(request, num_options, options);
+
+ /*
+ * Send the request and get the job-id...
+ */
- return (IPP_NOT_POSSIBLE);
+ response = cupsDoRequest(http, request, info->resource);
+
+ if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) != NULL)
+ {
+ *job_id = attr->values[0].integer;
+ DEBUG_printf(("1cupsCreateDestJob: job-id=%d", *job_id));
+ }
+
+ ippDelete(response);
+
+ /*
+ * Return the status code from the Create-Job request...
+ */
+
+ DEBUG_printf(("1cupsCreateDestJob: %s (%s)", ippErrorString(cupsLastError()),
+ cupsLastErrorString()));
+
+ return (cupsLastError());
}
/*
* 'cupsFinishDestDocument()' - Finish the current document.
*
- * Returns IPP_OK on success.
+ * Returns @code IPP_OK@ or @code IPP_OK_SUBST@ on success.
*
* @since CUPS 1.6@
*/
-ipp_status_t
+ipp_status_t /* O - Status of document submission */
cupsFinishDestDocument(
- http_t *http, /* I - Connection to destination */
- cups_dest_t *dest) /* I - Destination */
+ http_t *http, /* I - Connection to destination */
+ cups_dest_t *dest, /* I - Destination */
+ cups_dinfo_t *info) /* I - Destination information */
{
- return (IPP_NOT_FOUND);
+ DEBUG_printf(("cupsFinishDestDocument(http=%p, dest=%p(%s/%s), info=%p)",
+ http, dest, dest ? dest->name : NULL,
+ dest ? dest->instance : NULL, info));
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !info)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+ DEBUG_puts("1cupsFinishDestDocument: Bad arguments.");
+ return (IPP_INTERNAL_ERROR);
+ }
+
+ /*
+ * Get the response at the end of the document and return it...
+ */
+
+ ippDelete(cupsGetResponse(http, info->resource));
+
+ DEBUG_printf(("1cupsFinishDestDocument: %s (%s)",
+ ippErrorString(cupsLastError()), cupsLastErrorString()));
+
+ return (cupsLastError());
}
@@ -119,12 +273,12 @@ cupsFinishDestDocument(
* document (see CUPS_FORMAT_xxx constants), and "num_options" and "options"
* are the options do be applied to the document. "last_document" should be 1
* if this is the last document to be submitted in the job. Returns
- * HTTP_CONTINUE on success.
+ * @code HTTP_CONTINUE@ on success.
*
* @since CUPS 1.6@
*/
-http_status_t
+http_status_t /* O - Status of document creation */
cupsStartDestDocument(
http_t *http, /* I - Connection to destination */
cups_dest_t *dest, /* I - Destination */
@@ -136,7 +290,64 @@ cupsStartDestDocument(
cups_option_t *options, /* I - Document options */
int last_document) /* I - 1 if this is the last document */
{
- return (HTTP_CONTINUE);
+ ipp_t *request; /* Send-Document request */
+ http_status_t status; /* HTTP status */
+
+
+ DEBUG_printf(("cupsStartDestDocument(http=%p, dest=%p(%s/%s), info=%p, "
+ "job_id=%d, docname=\"%s\", format=\"%s\", num_options=%d, "
+ "options=%p, last_document=%d)",
+ http, dest, dest ? dest->name : NULL,
+ dest ? dest->instance : NULL, info, job_id, docname, format,
+ num_options, options, last_document));
+
+ /*
+ * Range check input...
+ */
+
+ if (!http || !dest || !info || job_id <= 0)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
+ DEBUG_puts("1cupsStartDestDocument: Bad arguments.");
+ return (HTTP_ERROR);
+ }
+
+ /*
+ * Create a Send-Document request...
+ */
+
+ if ((request = ippNewRequest(IPP_SEND_DOCUMENT)) == NULL)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
+ DEBUG_puts("1cupsStartDestDocument: Unable to create Send-Document "
+ "request.");
+ return (HTTP_ERROR);
+ }
+
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, info->uri);
+ ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", job_id);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
+ NULL, cupsUser());
+ if (docname)
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "document-name",
+ NULL, docname);
+ if (format)
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
+ "document-format", NULL, format);
+ ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", last_document);
+
+ cupsEncodeOptions2(request, num_options, options, IPP_TAG_DOCUMENT);
+
+ /*
+ * Send and delete the request, then return the status...
+ */
+
+ status = cupsSendRequest(http, request, info->resource, CUPS_LENGTH_VARIABLE);
+
+ ippDelete(request);
+
+ return (status);
}
diff --git a/cups/dest-options.c b/cups/dest-options.c
index af5a26256..a36b5334e 100644
--- a/cups/dest-options.c
+++ b/cups/dest-options.c
@@ -15,7 +15,7 @@
*
* Contents:
*
- * cupsCheckDestSupported() - Check that the option and value are supported
+* cupsCheckDestSupported() - Check that the option and value are supported
* by the destination.
* cupsCopyDestConflicts() - Get conflicts and resolutions for a new
* option/value pair.
@@ -292,7 +292,7 @@ cupsCopyDestConflicts(
return (0);
/*
- * Check for an resolve any conflicts...
+ * Check for and resolve any conflicts...
*/
/* TODO: implement me! */
@@ -821,7 +821,7 @@ cups_create_media_db(
mdb.top =
mdb.bottom = 1270; /* Default 1/2" top/bottom margins */
- for (i = media_col_db->num_values, val = media_col_db->values;
+ for (i = media_attr->num_values, val = media_attr->values;
i > 0;
i --, val ++)
{
diff --git a/cups/dest.c b/cups/dest.c
index c5f83a076..bf9a0dcc4 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -348,11 +348,6 @@ _cupsAppleCopyDefaultPrinter(void)
return (NULL);
}
-//# ifdef DEBUG
-// CFStringGetCString(network, name, namesize, kCFStringEncodingUTF8);
-// DEBUG_printf(("2_cupsUserDefault: network=\"%s\"", name));
-//# endif /* DEBUG */
-
/*
* Lookup the network in the preferences...
*/
@@ -837,7 +832,7 @@ cupsEnumDests(
{
int i, /* Looping var */
num_dests; /* Number of destinations */
- cups_dest_t *dests, /* Destinations */
+ cups_dest_t *dests = NULL, /* Destinations */
*dest; /* Current destination */
#ifdef HAVE_DNSSD
int nfds, /* Number of files responded */
@@ -1934,7 +1929,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
#endif /* WIN32 */
char filename[1024]; /* lpoptions file */
int num_temps; /* Number of temporary destinations */
- cups_dest_t *temps, /* Temporary destinations */
+ cups_dest_t *temps = NULL, /* Temporary destinations */
*temp; /* Current temporary dest */
const char *val; /* Value of temporary option */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
@@ -2801,11 +2796,9 @@ cups_dnssd_query_cb(
model[256], /* Model */
uriname[1024], /* Name for URI */
uri[1024]; /* Printer URI */
- cups_ptype_t type; /* Device type */
device->state = _CUPS_DNSSD_PENDING;
make_and_model[0] = '\0';
- type = CUPS_PRINTER_REMOTE;
strcpy(model, "Unknown");
@@ -2881,7 +2874,6 @@ cups_dnssd_query_cb(
device->dest.num_options = cupsAddOption("printer-type", value,
device->dest.num_options,
&device->dest.options);
- type = strtol(value, NULL, 0);
}
}
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c
index 917150e9c..93e4df58f 100644
--- a/cups/http-addrlist.c
+++ b/cups/http-addrlist.c
@@ -32,7 +32,9 @@
#ifdef HAVE_POLL
# include
#endif /* HAVE_POLL */
-#include
+#ifndef WIN32
+# include
+#endif /* WIN32 */
/*
diff --git a/cups/http-support.c b/cups/http-support.c
index b886515bd..40c69826f 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -1508,8 +1508,7 @@ _httpResolveURI(
{
localref = ref;
if (DNSServiceResolve(&localref,
- kDNSServiceFlagsShareConnection |
- kDNSServiceFlagsTimeout, 0, hostname, regtype,
+ kDNSServiceFlagsShareConnection, 0, hostname, regtype,
"local.", http_resolve_cb,
&uribuf) == kDNSServiceErr_NoError)
{
@@ -1547,7 +1546,11 @@ _httpResolveURI(
FD_ZERO(&input_set);
FD_SET(DNSServiceRefSockFD(ref), &input_set);
+#ifdef WIN32
+ stimeout.tv_sec = (long)timeout;
+#else
stimeout.tv_sec = timeout;
+#endif /* WIN32 */
stimeout.tv_usec = 0;
fds = select(DNSServiceRefSockFD(ref)+1, &input_set, NULL, NULL,
@@ -1579,8 +1582,7 @@ _httpResolveURI(
domainref = ref;
if (DNSServiceResolve(&domainref,
- kDNSServiceFlagsShareConnection |
- kDNSServiceFlagsTimeout,
+ kDNSServiceFlagsShareConnection,
0, hostname, regtype, domain,
http_resolve_cb,
&uribuf) == kDNSServiceErr_NoError)
diff --git a/cups/http.c b/cups/http.c
index 1f2d826dd..b95baa9d0 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -4163,7 +4163,8 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
break;
case errSSLWouldBlock :
- usleep(1000);
+ error = noErr; /* Force a retry */
+ usleep(1000); /* in 1 millisecond */
break;
# ifdef HAVE_SECCERTIFICATECOPYDATA
@@ -4199,7 +4200,7 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
{
data = (CFDataRef)CFArrayGetValueAtIndex(dn_array, i);
- if ((credential = malloc(sizeof(*credential))))
+ if ((credential = malloc(sizeof(*credential))) != NULL)
{
credential->datalen = CFDataGetLength(data);
if ((credential->data = malloc(credential->datalen)))
@@ -4520,7 +4521,8 @@ http_write(http_t *http, /* I - Connection to server */
pfd.events = POLLOUT;
while ((nfds = poll(&pfd, 1, http->wait_value)) < 0 &&
- (errno == EINTR || errno == EAGAIN));
+ (errno == EINTR || errno == EAGAIN))
+ /* do nothing */;
#else
do
diff --git a/cups/ipp-private.h b/cups/ipp-private.h
index 70729cf59..1d3003c3f 100644
--- a/cups/ipp-private.h
+++ b/cups/ipp-private.h
@@ -46,103 +46,6 @@ extern "C" {
* Structures...
*/
-typedef union _ipp_request_u /**** Request Header ****/
-{
- struct /* Any Header */
- {
- ipp_uchar_t version[2]; /* Protocol version number */
- int op_status; /* Operation ID or status code*/
- int request_id; /* Request ID */
- } any;
-
- struct /* Operation Header */
- {
- ipp_uchar_t version[2]; /* Protocol version number */
- ipp_op_t operation_id; /* Operation ID */
- int request_id; /* Request ID */
- } op;
-
- struct /* Status Header */
- {
- ipp_uchar_t version[2]; /* Protocol version number */
- ipp_status_t status_code; /* Status code */
- int request_id; /* Request ID */
- } status;
-
- /**** New in CUPS 1.1.19 ****/
- struct /* Event Header @since CUPS 1.1.19/Mac OS X 10.3@ */
- {
- ipp_uchar_t version[2]; /* Protocol version number */
- ipp_status_t status_code; /* Status code */
- int request_id; /* Request ID */
- } event;
-} _ipp_request_t;
-
-/**** New in CUPS 1.1.19 ****/
-
-typedef union _ipp_value_u /**** Attribute Value ****/
-{
- int integer; /* Integer/enumerated value */
-
- char boolean; /* Boolean value */
-
- ipp_uchar_t date[11]; /* Date/time value */
-
- struct
- {
- int xres, /* Horizontal resolution */
- yres; /* Vertical resolution */
- ipp_res_t units; /* Resolution units */
- } resolution; /* Resolution value */
-
- struct
- {
- int lower, /* Lower value */
- upper; /* Upper value */
- } range; /* Range of integers value */
-
- struct
- {
- char *language; /* Language code */
- char *text; /* String */
- } string; /* String with language value */
-
- struct
- {
- int length; /* Length of attribute */
- void *data; /* Data in attribute */
- } unknown; /* Unknown attribute type */
-
-/**** New in CUPS 1.1.19 ****/
- ipp_t *collection; /* Collection value @since CUPS 1.1.19/Mac OS X 10.3@ */
-} _ipp_value_t;
-
-struct _ipp_attribute_s /**** Attribute ****/
-{
- ipp_attribute_t *next; /* Next attribute in list */
- ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
- value_tag; /* What type of value is it? */
- char *name; /* Name of attribute */
- int num_values; /* Number of values */
- _ipp_value_t values[1]; /* Values */
-};
-
-struct _ipp_s /**** IPP Request/Response/Notification ****/
-{
- ipp_state_t state; /* State of request */
- _ipp_request_t request; /* Request header */
- ipp_attribute_t *attrs; /* Attributes */
- ipp_attribute_t *last; /* Last attribute in list */
- ipp_attribute_t *current; /* Current attribute (for read/write) */
- ipp_tag_t curtag; /* Current attribute group tag */
-
-/**** New in CUPS 1.2 ****/
- ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/Mac OS X 10.5@ */
-
-/**** New in CUPS 1.4.4 ****/
- int use; /* Use count @since CUPS 1.4.4/Mac OS X 10.6.?@ */
-};
-
typedef struct /**** Attribute mapping data ****/
{
int multivalue; /* Option has multiple values? */
diff --git a/cups/ipp-support.c b/cups/ipp-support.c
index 362321a55..c20c11043 100644
--- a/cups/ipp-support.c
+++ b/cups/ipp-support.c
@@ -78,7 +78,11 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
"client-error-ignored-all-subscriptions",
"client-error-too-many-subscriptions",
"(client-error-ignored-all-notifications)",
- "(client-error-client-print-support-file-not-found)"
+ "(client-error-client-print-support-file-not-found)",
+ "client-error-document-password-error",
+ "client-error-document-permission-error",
+ "client-error-document-security-error",
+ "client-error-document-unprintable-error"
},
* const ipp_status_500s[] = /* Server errors */
{
@@ -158,7 +162,7 @@ static const char * const ipp_std_ops[] =
"Suspend-Current-Job",
"Resume-Job",
- /* 0x0030 - 0x003b */
+ /* 0x0030 - 0x003d */
"Promote-Job",
"Schedule-Job-After",
"0x32",
@@ -171,7 +175,8 @@ static const char * const ipp_std_ops[] =
"Cancel-My-Jobs",
"Resubmit-Job",
"Close-Job",
- "Identify-Printer"
+ "Identify-Printer",
+ "Validate-Document"
},
* const ipp_cups_ops[] =
{
diff --git a/cups/ipp.c b/cups/ipp.c
index 6b88d71de..ab5303c72 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -3,7 +3,7 @@
*
* Internet Printing Protocol functions for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -120,17 +120,24 @@
* Local functions...
*/
-static ipp_attribute_t *ipp_add_attr(ipp_t *ipp, const char *name, ipp_tag_t group_tag,
- ipp_tag_t value_tag, int num_values);
-static void ipp_free_values(ipp_attribute_t *attr, int element, int count);
-static char *ipp_get_code(const char *locale, char *buffer, size_t bufsize);
-static char *ipp_lang_code(const char *locale, char *buffer, size_t bufsize);
+static ipp_attribute_t *ipp_add_attr(ipp_t *ipp, const char *name,
+ ipp_tag_t group_tag, ipp_tag_t value_tag,
+ int num_values);
+static void ipp_free_values(ipp_attribute_t *attr, int element,
+ int count);
+static char *ipp_get_code(const char *locale, char *buffer,
+ size_t bufsize)
+ __attribute__((nonnull(1,2)));
+static char *ipp_lang_code(const char *locale, char *buffer,
+ size_t bufsize)
+ __attribute__((nonnull(1,2)));
static size_t ipp_length(ipp_t *ipp, int collection);
static ssize_t ipp_read_http(http_t *http, ipp_uchar_t *buffer,
size_t length);
static ssize_t ipp_read_file(int *fd, ipp_uchar_t *buffer,
size_t length);
-static _ipp_value_t *ipp_set_value(ipp_t *ipp, ipp_attribute_t **attr, int element);
+static _ipp_value_t *ipp_set_value(ipp_t *ipp, ipp_attribute_t **attr,
+ int element);
static ssize_t ipp_write_file(int *fd, ipp_uchar_t *buffer,
size_t length);
@@ -1058,14 +1065,17 @@ ippAddString(ipp_t *ipp, /* I - IPP message */
attr->values[0].string.language = _cupsStrAlloc(ipp_lang_code(language, code,
sizeof(code)));
- if (value_tag == IPP_TAG_CHARSET)
- attr->values[0].string.text = _cupsStrAlloc(ipp_get_code(value, code,
- sizeof(code)));
- else if (value_tag == IPP_TAG_LANGUAGE)
- attr->values[0].string.text = _cupsStrAlloc(ipp_lang_code(value, code,
- sizeof(code)));
- else
- attr->values[0].string.text = _cupsStrAlloc(value);
+ if (value)
+ {
+ if (value_tag == IPP_TAG_CHARSET)
+ attr->values[0].string.text = _cupsStrAlloc(ipp_get_code(value, code,
+ sizeof(code)));
+ else if (value_tag == IPP_TAG_LANGUAGE)
+ attr->values[0].string.text = _cupsStrAlloc(ipp_lang_code(value, code,
+ sizeof(code)));
+ else
+ attr->values[0].string.text = _cupsStrAlloc(value);
+ }
}
return (attr);
@@ -2467,7 +2477,7 @@ ippReadIO(void *src, /* I - Data source */
DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
src, cb, blocking, parent, ipp));
- DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp->state));
+ DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_ERROR));
if (!src || !ipp)
return (IPP_ERROR);
@@ -5349,10 +5359,6 @@ ipp_read_http(http_t *http, /* I - Client connection */
}
else
{
- /*
- * Wait a maximum of 1 second for data...
- */
-
if (!http->blocking)
{
/*
diff --git a/cups/ipp.h b/cups/ipp.h
index 950e4005c..d0556d363 100644
--- a/cups/ipp.h
+++ b/cups/ipp.h
@@ -3,7 +3,7 @@
*
* Internet Printing Protocol definitions for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -188,6 +188,7 @@ typedef enum ipp_op_e /**** IPP operations ****/
IPP_RESUBMIT_JOB, /* Resubmit-Job */
IPP_CLOSE_JOB, /* Close-Job */
IPP_IDENTIFY_PRINTER, /* Identify-Printer (proposed IPP JPS3) */
+ IPP_VALIDATE_DOCUMENT, /* Validate-Document (proposed IPP JPS3) */
IPP_PRIVATE = 0x4000, /* Reserved @private@ */
CUPS_GET_DEFAULT, /* Get the default printer */
CUPS_GET_PRINTERS, /* Get a list of printers and/or classes */
@@ -373,6 +374,129 @@ typedef ssize_t (*ipp_iocb_t)(void *context, ipp_uchar_t *buffer, size_t bytes);
typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
+/*
+ * The following structures are PRIVATE starting with CUPS 1.6. Please use the
+ * new accessor functions available in CUPS 1.6 and later, as these definitions
+ * will be moved to a private header file in a future release.
+ *
+ * Define _IPP_PRIVATE_STRUCTURES to cause the private IPP structures to be
+ * exposed in CUPS 1.6.
+ */
+
+# if defined(_CUPS_SOURCE) || defined(_CUPS_IPP_PRIVATE_H_)
+ /* Building CUPS */
+# define _IPP_PRIVATE_STRUCTURES 1
+# elif defined(__APPLE__)
+# if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
+ /* Building for 10.7 and earlier */
+# define _IPP_PRIVATE_STRUCTURES 1
+# elif !defined(MAC_OS_X_VERSION_10_8)
+ /* Building for 10.7 and earlier */
+# define _IPP_PRIVATE_STRUCTURES 1
+# endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
+# endif /* _CUPS_SOURCE || _CUPS_IPP_PRIVATE_H_ */
+
+# ifdef _IPP_PRIVATE_STRUCTURES
+typedef union _ipp_request_u /**** Request Header ****/
+{
+ struct /* Any Header */
+ {
+ ipp_uchar_t version[2]; /* Protocol version number */
+ int op_status; /* Operation ID or status code*/
+ int request_id; /* Request ID */
+ } any;
+
+ struct /* Operation Header */
+ {
+ ipp_uchar_t version[2]; /* Protocol version number */
+ ipp_op_t operation_id; /* Operation ID */
+ int request_id; /* Request ID */
+ } op;
+
+ struct /* Status Header */
+ {
+ ipp_uchar_t version[2]; /* Protocol version number */
+ ipp_status_t status_code; /* Status code */
+ int request_id; /* Request ID */
+ } status;
+
+ /**** New in CUPS 1.1.19 ****/
+ struct /* Event Header @since CUPS 1.1.19/Mac OS X 10.3@ */
+ {
+ ipp_uchar_t version[2]; /* Protocol version number */
+ ipp_status_t status_code; /* Status code */
+ int request_id; /* Request ID */
+ } event;
+} _ipp_request_t;
+
+/**** New in CUPS 1.1.19 ****/
+
+typedef union _ipp_value_u /**** Attribute Value ****/
+{
+ int integer; /* Integer/enumerated value */
+
+ char boolean; /* Boolean value */
+
+ ipp_uchar_t date[11]; /* Date/time value */
+
+ struct
+ {
+ int xres, /* Horizontal resolution */
+ yres; /* Vertical resolution */
+ ipp_res_t units; /* Resolution units */
+ } resolution; /* Resolution value */
+
+ struct
+ {
+ int lower, /* Lower value */
+ upper; /* Upper value */
+ } range; /* Range of integers value */
+
+ struct
+ {
+ char *language; /* Language code */
+ char *text; /* String */
+ } string; /* String with language value */
+
+ struct
+ {
+ int length; /* Length of attribute */
+ void *data; /* Data in attribute */
+ } unknown; /* Unknown attribute type */
+
+/**** New in CUPS 1.1.19 ****/
+ ipp_t *collection; /* Collection value @since CUPS 1.1.19/Mac OS X 10.3@ */
+} _ipp_value_t;
+typedef _ipp_value_t ipp_value_t; /**** Convenience typedef that will be removed @private@ ****/
+
+struct _ipp_attribute_s /**** Attribute ****/
+{
+ ipp_attribute_t *next; /* Next attribute in list */
+ ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
+ value_tag; /* What type of value is it? */
+ char *name; /* Name of attribute */
+ int num_values; /* Number of values */
+ _ipp_value_t values[1]; /* Values */
+};
+
+struct _ipp_s /**** IPP Request/Response/Notification ****/
+{
+ ipp_state_t state; /* State of request */
+ _ipp_request_t request; /* Request header */
+ ipp_attribute_t *attrs; /* Attributes */
+ ipp_attribute_t *last; /* Last attribute in list */
+ ipp_attribute_t *current; /* Current attribute (for read/write) */
+ ipp_tag_t curtag; /* Current attribute group tag */
+
+/**** New in CUPS 1.2 ****/
+ ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/Mac OS X 10.5@ */
+
+/**** New in CUPS 1.4.4 ****/
+ int use; /* Use count @since CUPS 1.4.4/Mac OS X 10.6.?@ */
+};
+# endif /* _IPP_PRIVATE_STRUCTURES */
+
+
/*
* Prototypes...
*/
diff --git a/cups/language.c b/cups/language.c
index 2e91ad9d4..3e9db9ff8 100644
--- a/cups/language.c
+++ b/cups/language.c
@@ -3,7 +3,7 @@
*
* I18N/language support for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -938,7 +938,23 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
*/
if (m)
- cupsArrayAdd(a, m);
+ {
+ if (m->str && m->str[0])
+ {
+ cupsArrayAdd(a, m);
+ }
+ else
+ {
+ /*
+ * Translation is empty, don't add it... (STR #4033)
+ */
+
+ free(m->id);
+ if (m->str)
+ free(m->str);
+ free(m);
+ }
+ }
/*
* Create a new message with the given msgid string...
@@ -968,6 +984,11 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
if ((temp = realloc(m->str ? m->str : m->id,
length + strlen(ptr) + 1)) == NULL)
{
+ if (m->str)
+ free(m->str);
+ free(m->id);
+ free(m);
+
cupsFileClose(fp);
return (a);
}
@@ -1005,6 +1026,9 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
if ((m->str = strdup(ptr)) == NULL)
{
+ free(m->id);
+ free(m);
+
cupsFileClose(fp);
return (a);
}
@@ -1016,7 +1040,23 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
*/
if (m)
- cupsArrayAdd(a, m);
+ {
+ if (m->str && m->str[0])
+ {
+ cupsArrayAdd(a, m);
+ }
+ else
+ {
+ /*
+ * Translation is empty, don't add it... (STR #4033)
+ */
+
+ free(m->id);
+ if (m->str)
+ free(m->str);
+ free(m);
+ }
+ }
/*
* Close the message catalog file and return the new array...
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index cf34a00bd..d39bf14e5 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -753,12 +753,15 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
}
/*
- * If we have a similar paper with non-zero margins then we only
- * want to keep it if it has a larger imageable area length.
+ * If we have a similar paper with non-zero margins then we only want to
+ * keep it if it has a larger imageable area length. The NULL check is for
+ * dimensions that are <= 0...
*/
- pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
- _PWG_FROMPTS(ppd_size->length));
+ if ((pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
+ _PWG_FROMPTS(ppd_size->length))) == NULL)
+ continue;
+
new_width = pwg_media->width;
new_length = pwg_media->length;
new_left = _PWG_FROMPTS(ppd_size->left);
diff --git a/cups/ppd.c b/cups/ppd.c
index b3d4baeb8..2c826ff1b 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -462,8 +462,8 @@ _ppdOpen(
ppd_attr_t *custom_attr; /* CustomFoo attribute */
char ll[4], /* Language + '.' */
ll_CC[7]; /* Language + country + '.' */
- size_t ll_len, /* Language length */
- ll_CC_len; /* Language + country length */
+ size_t ll_len = 0, /* Language length */
+ ll_CC_len = 0; /* Language + country length */
static const char * const ui_keywords[] =
{
#ifdef CUPS_USE_FULL_UI_KEYWORDS_LIST
diff --git a/cups/ppd.h b/cups/ppd.h
index 2f9390fdd..049340efc 100644
--- a/cups/ppd.h
+++ b/cups/ppd.h
@@ -7,7 +7,7 @@
* -D_PPD_DEPRECATED="" TO YOUR COMPILE OPTIONS. THIS HEADER AND THESE
* FUNCTIONS WILL BE REMOVED IN A FUTURE RELEASE OF CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -56,7 +56,19 @@ extern "C" {
*/
# ifndef _PPD_DEPRECATED
-# define _PPD_DEPRECATED _CUPS_DEPRECATED
+# if defined(__APPLE__)
+# if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
+ /* Building for 10.7 and earlier */
+# define _PPD_DEPRECATED
+# elif !defined(MAC_OS_X_VERSION_10_8)
+ /* Building for 10.7 and earlier */
+# define _PPD_DEPRECATED
+# else
+# define _PPD_DEPRECATED _CUPS_DEPRECATED
+# endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
+# else
+# define _PPD_DEPRECATED _CUPS_DEPRECATED
+# endif /* __APPLE__ */
# endif /* !_PPD_DEPRECATED */
diff --git a/cups/pwg-media.c b/cups/pwg-media.c
index e99f57ff3..24528868c 100644
--- a/cups/pwg-media.c
+++ b/cups/pwg-media.c
@@ -3,7 +3,7 @@
*
* PWG media name API implementation for CUPS.
*
- * Copyright 2009-2011 by Apple Inc.
+ * Copyright 2009-2012 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
diff --git a/cups/request.c b/cups/request.c
index 9d004c39b..b71f7ffb0 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -643,11 +643,10 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
}
else if (http->state != HTTP_WAITING)
{
- DEBUG_printf(("1cupsSendRequest: Unknown HTTP state (%d), bailing.",
- http->state));
- _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
-
- return (HTTP_ERROR);
+ DEBUG_printf(("1cupsSendRequest: Unknown HTTP state (%d), "
+ "reconnecting.", http->state));
+ if (httpReconnect(http))
+ return (HTTP_ERROR);
}
#ifdef HAVE_SSL
diff --git a/cups/sidechannel.c b/cups/sidechannel.c
index da2f77a2b..40091deca 100644
--- a/cups/sidechannel.c
+++ b/cups/sidechannel.c
@@ -3,7 +3,7 @@
*
* Side-channel API code for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -150,7 +150,7 @@ cupsSideChannelRead(
pfd.fd = CUPS_SC_FD;
pfd.events = POLLIN;
- while ((nfds = poll(&pfd, 1,
+ while ((nfds = poll(&pfd, 1,
timeout < 0.0 ? -1 : (long)(timeout * 1000))) < 0 &&
(errno == EINTR || errno == EAGAIN))
;
@@ -162,14 +162,14 @@ cupsSideChannelRead(
stimeout.tv_sec = (int)timeout;
stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
- while ((nfds = select(CUPS_SC_FD + 1, &input_set, NULL, NULL,
+ while ((nfds = select(CUPS_SC_FD + 1, &input_set, NULL, NULL,
timeout < 0.0 ? NULL : &stimeout)) < 0 &&
(errno == EINTR || errno == EAGAIN))
;
#endif /* HAVE_POLL */
- if (nfds < 1)
+ if (nfds < 1)
{
*command = CUPS_SC_CMD_NONE;
*status = nfds==0 ? CUPS_SC_STATUS_TIMEOUT : CUPS_SC_STATUS_IO_ERROR;
@@ -308,7 +308,7 @@ cupsSideChannelRead(
* support SNMP queries. @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when
* the printer does not respond to the SNMP query.
*
- * @since CUPS 1.4/Mac OS X 10.6@
+ * @since CUPS 1.4/Mac OS X 10.6@
*/
cups_sc_status_t /* O - Query status */
@@ -414,7 +414,7 @@ cupsSideChannelSNMPGet(
* support SNMP queries. @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when
* the printer does not respond to the first SNMP query.
*
- * @since CUPS 1.4/Mac OS X 10.6@
+ * @since CUPS 1.4/Mac OS X 10.6@
*/
cups_sc_status_t /* O - Status of first query of @code CUPS_SC_STATUS_OK@ on success */
@@ -509,7 +509,7 @@ cupsSideChannelSNMPWalk(
* Call the callback with the OID and data...
*/
- (*cb)(real_data, real_data + real_oidlen, real_datalen, context);
+ (*cb)(real_data, real_data + real_oidlen, real_datalen, context);
/*
* Update the current OID...
diff --git a/cups/snmp-private.h b/cups/snmp-private.h
index 2c6d95371..fbd5467ab 100644
--- a/cups/snmp-private.h
+++ b/cups/snmp-private.h
@@ -31,9 +31,10 @@
*/
#define CUPS_SNMP_PORT 161 /* SNMP well-known port */
+#define CUPS_SNMP_MAX_COMMUNITY 512 /* Maximum size of community name */
#define CUPS_SNMP_MAX_OID 128 /* Maximum number of OID numbers */
#define CUPS_SNMP_MAX_PACKET 1472 /* Maximum size of SNMP packet */
-#define CUPS_SNMP_MAX_STRING 512 /* Maximum size of string */
+#define CUPS_SNMP_MAX_STRING 65536 /* Maximum size of string */
#define CUPS_SNMP_VERSION_1 0 /* SNMPv1 */
@@ -84,7 +85,7 @@ typedef struct cups_snmp_s /**** SNMP data packet ****/
const char *error; /* Encode/decode error */
http_addr_t address; /* Source address */
int version; /* Version number */
- char community[CUPS_SNMP_MAX_STRING];
+ char community[CUPS_SNMP_MAX_COMMUNITY];
/* Community name */
cups_asn1_t request_type; /* Request type */
int request_id; /* request-id value */
diff --git a/cups/testconflicts.c b/cups/testconflicts.c
index 6f55f0ff4..269c53ec3 100644
--- a/cups/testconflicts.c
+++ b/cups/testconflicts.c
@@ -3,7 +3,7 @@
*
* PPD constraint test program for CUPS.
*
- * Copyright 2008-2011 by Apple Inc.
+ * Copyright 2008-2012 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -91,7 +91,13 @@ main(int argc, /* I - Number of command-line arguments */
if (option)
{
free(option);
+ option = NULL;
+ }
+
+ if (choice)
+ {
free(choice);
+ choice = NULL;
}
printf("\nNew Option(s): ");
@@ -118,6 +124,11 @@ main(int argc, /* I - Number of command-line arguments */
cupsFreeOptions(num_options, options);
}
+ if (option)
+ free(option);
+ if (choice)
+ free(choice);
+
return (0);
}
diff --git a/cups/util.c b/cups/util.c
index 8227f3e58..e6fb06d0a 100644
--- a/cups/util.c
+++ b/cups/util.c
@@ -1573,7 +1573,7 @@ cupsStartDocument(
if ((request = ippNewRequest(IPP_SEND_DOCUMENT)) == NULL)
{
_cupsSetError(IPP_INTERNAL_ERROR, strerror(ENOMEM), 0);
- return (0);
+ return (HTTP_ERROR);
}
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri), "ipp",
diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html
index b04021e9c..394be16cd 100644
--- a/doc/help/api-httpipp.html
+++ b/doc/help/api-httpipp.html
@@ -595,7 +595,9 @@ are server-oriented...">http_state_t
http_uri_status_t
http_version_t
ipp_attribute_t
- ipp_copycb_t
+ ipp_copycb_t
ipp_dstate_t
ipp_finish_t
ipp_iocb_t
@@ -647,7 +649,7 @@ are server-oriented...">http_state_e
HTTP and IPP API introduction for CUPS.
- Copyright 2007-2011 by Apple Inc.
+ Copyright 2007-2012 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -673,35 +675,20 @@ The constant CUPS_HTTP_DEFAULT
can be used with all of the
cups
functions to refer to the default CUPS server - the functions
create a per-thread http_t
as needed.
-The IPP APIs use two structures for requests (messages sent to the CUPS
-scheduler) and responses (messages sent back to your application from the
-scheduler). The ipp_t
structure holds a
-complete request or response and is allocated using the
-ippNew
or
-ippNewRequest
functions and
-freed using the ippDelete
function.
-
-The second structure is called
-ipp_attribute_t
and holds a
-single IPP attribute which consists of a group tag (group_tag
), a
-value type tag (value_tag
), the attribute name (name
),
-and 1 or more values (values[]
). Attributes are added to an
-ipp_t
structure using one of the
-ippAdd
functions. For example, use
-ippAddString
to add a
-"requesting-user-name" string attribute to a request:
+The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The ipp_t
type holds a complete request or response and is allocated using the ippNew
or ippNewRequest
functions and freed using the ippDelete
function.
+
+The second opaque structure is called ipp_attribute_t
and holds a single IPP attribute which consists of a group tag (ippGetGroupTag
), a value type tag (ippGetValueTag
), the attribute name (ippGetName
), and 1 or more values (ippGetCount
, ippGetBoolean
, ippGetCollection
, ippGetDate
, ippGetInteger
, ippGetRange
, ippGetResolution
, and ippGetString
). Attributes are added to an ipp_t
pointer using one of the ippAdd
functions. For example, use ippAddString
to add the "printer-uri" and "requesting-user-name" string attributes to a request:
ipp_t *request = ippNewRequest(IPP_GET_JOBS);
+ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, "ipp://localhost/printers/");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
-Once you have created an IPP request, use the cups
-functions to send the request to and read the response from the server.
-For example, the cupsDoRequest
-function can be used for simple query operations that do not involve files:
+Once you have created an IPP request, use the cups
functions to send the request to and read the response from the server. For example, the cupsDoRequest
function can be used for simple query operations that do not involve files:
#include <cups/cups.h>
@@ -711,6 +698,8 @@ function can be used for simple query operations that do not involve files:
{
ipp_t *request = ippNewRequest(IPP_GET_JOBS);
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+ NULL, "ipp://localhost/printers/");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
@@ -718,13 +707,7 @@ function can be used for simple query operations that do not involve files:
}
-The cupsDoRequest
function frees
-the request structure and returns an IPP response structure or NULL pointer if
-the request could not be sent to the server. Once you have a response from
-the server, you can either use the
-ippFindAttribute
and
-ippFindNextAttribute
functions
-to find specific attributes, for example:
+The cupsDoRequest
function frees the request and returns an IPP response or NULL
pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the ippFindAttribute
and ippFindNextAttribute
functions to find specific attributes, for example:
ipp_t *response;
@@ -733,25 +716,20 @@ to find specific attributes, for example:
attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM);
-You can also walk the list of attributes with a simple for
loop
-like this:
+You can also walk the list of attributes with a simple for
loop like this:
ipp_t *response;
ipp_attribute_t *attr;
-for (attr = response->attrs; attr != NULL; attr = attr->next)
- if (attr->name == NULL)
+for (attr = ippFirstAttribute(response); attr != NULL; attr = ippNextAttribute(response))
+ if (ippGetName(attr) == NULL)
puts("--SEPARATOR--");
else
- puts(attr->name);
+ puts(ippGetName(attr));
-The for
loop approach is normally used when collecting
-attributes for multiple objects (jobs, printers, etc.) in a response. Attributes
-with NULL
names indicate a separator between the attributes of
-each object. For example, the following code will list the jobs returned from
-our previous get_jobs
example code:
+The for
loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with NULL
names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous get_jobs
example code:
ipp_t *response = get_jobs();
@@ -759,37 +737,55 @@ our previous get_jobs
example code:
if (response != NULL)
{
ipp_attribute_t *attr;
+ const char *attrname;
int job_id = 0;
- char *job_name = NULL;
- char *job_originating_user_name = NULL;
+ const char *job_name = NULL;
+ const char *job_originating_user_name = NULL;
puts("Job ID Owner Title");
puts("------ ---------------- ---------------------------------");
- for (attr = response->attrs; attr != NULL; attr = attr->next)
+ for (attr = ippFirstAttribute(response); attr != NULL; attr = ippNextAttribute(response))
{
/* Attributes without names are separators between jobs */
- if (attr->name == NULL)
+ attrname = ippGetName(attr);
+ if (attrname == NULL)
{
- if (job_id > 0 && job_name != NULL && job_originating_user_name != NULL)
+ if (job_id > 0)
+ {
+ if (job_name == NULL)
+ job_name = "(withheld)";
+
+ if (job_originating_user_name == NULL)
+ job_originating_user_name = "(withheld)";
+
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
+ }
job_id = 0;
job_name = NULL;
job_originating_user_name = NULL;
continue;
}
- else if (!strcmp(attr->name, "job-id") && attr->value_tag == IPP_TAG_INTEGER)
- job_id = attr->values[0].integer;
- else if (!strcmp(attr->name, "job-name") && attr->value_tag == IPP_TAG_NAME)
- job_name = attr->values[0].string.text;
- else if (!strcmp(attr->name, "job-originating-user-name") &&
- attr->value_tag == IPP_TAG_NAME)
- job_originating_user_name = attr->values[0].string.text;
+ else if (!strcmp(attrname, "job-id") && ippGetValueTag(attr) == IPP_TAG_INTEGER)
+ job_id = ippGetInteger(attr, 0);
+ else if (!strcmp(attrname, "job-name") && ippGetValueTag(attr) == IPP_TAG_NAME)
+ job_name = ippGetString(attr, 0, NULL);
+ else if (!strcmp(attrname, "job-originating-user-name") &&
+ ippGetValueTag(attr) == IPP_TAG_NAME)
+ job_originating_user_name = ippGetString(attr, 0, NULL);
}
- if (job_id > 0 && job_name != NULL && job_originating_user_name != NULL)
+ if (job_id > 0)
+ {
+ if (job_name == NULL)
+ job_name = "(withheld)";
+
+ if (job_originating_user_name == NULL)
+ job_originating_user_name = "(withheld)";
+
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
+ }
}
@@ -4640,7 +4636,9 @@ typedef enum http_version_e http_version_t;
typedef struct _ipp_attribute_s ipp_attribute_t;
-Prototypes...
+The following structures are PRIVATE starting with CUPS 1.6. Please use the
+new accessor functions available in CUPS 1.6 and later, as these definitions
+will be moved to a private header file in a future release.
typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
@@ -5250,6 +5248,8 @@ are server-oriented...
Add a file to a job
IPP_SET_JOB_ATTRIBUTES
Set job attributes
+IPP_VALIDATE_DOCUMENT
+Validate-Document (proposed IPP JPS3)
IPP_VALIDATE_JOB
Validate job options
diff --git a/doc/help/api-ppdc.html b/doc/help/api-ppdc.html
index 458778139..e9c945b59 100644
--- a/doc/help/api-ppdc.html
+++ b/doc/help/api-ppdc.html
@@ -1016,12 +1016,15 @@ void ~ppdcDriver (void);
// File
class ppdcFile {
public:
+ bool close_on_delete;
const char *filename;
cups_file_t *fp;
int line;
};
Members
+- close_on_delete
+- Close file on delete?
- filename
- Filename
- fp
diff --git a/doc/help/man-ipptoolfile.html b/doc/help/man-ipptoolfile.html
index baab6fefb..24b213353 100644
--- a/doc/help/man-ipptoolfile.html
+++ b/doc/help/man-ipptoolfile.html
@@ -336,16 +336,61 @@ matches or does not match.
- Requires the EXPECT attribute to have the same number of values as the specified
parallel attribute.
+- WITH-ALL-VALUES "literal string"
+
+- Requires that all values of the EXPECT attribute match the literal string. Comparisons are case-sensitive.
+
+- WITH-ALL-VALUES <number
+
+
+- WITH-ALL-VALUES =number
+
+
+- WITH-ALL-VALUES >number
+
+
+- WITH-ALL-VALUES number[,number,...]
+
+- Requires that all values of the EXPECT attribute match the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range.
+
+- WITH-ALL-VALUES "false"
+
+
+- WITH-ALL-VALUES "true"
+
+- Requires that all values of the EXPECT attribute match the boolean value given.
+
+- WITH-ALL-VALUES "/regular expression/"
+
+- Requires that all values of the EXPECT attribute match the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
+
- WITH-VALUE "literal string"
-- Requires at least one value of the EXPECT attribute to match the literal string.
-Comparisons are case-sensitive.
+
- Requires that at least one value of the EXPECT attribute matches the literal string. Comparisons are case-sensitive.
+
+ - WITH-VALUE <number
+
+
+- WITH-VALUE =number
+
+
+- WITH-VALUE >number
+
+
+- WITH-VALUE number[,number,...]
+
+- Requires that at least one value of the EXPECT attribute matches the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range.
+
+- WITH-VALUE "false"
+
+
+- WITH-VALUE "true"
+
+- Requires that at least one value of the EXPECT attribute matches the boolean value given.
- WITH-VALUE "/regular expression/"
-- Requires that all values of the EXPECT attribute match the regular expression,
-which must conform to the POSIX regular expression syntax.
-Comparisons are case-sensitive.
+
- Requires that at least one value of the EXPECT attribute matches the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
@@ -413,6 +458,7 @@ RFC 2911 and other IPP extension specifications. Here is a complete list:
Get-Subscriptions
Hold-Job
Hold-New-Jobs
+ Identify-Printer
Pause-Printer
Pause-Printer-After-Current-Job
Print-Job
@@ -437,6 +483,7 @@ RFC 2911 and other IPP extension specifications. Here is a complete list:
Shutdown-Printer
Startup-Printer
Suspend-Current-Job
+ Validate-Document
Validate-Job
@@ -454,6 +501,10 @@ Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC
client-error-document-access-error
client-error-document-format-error
client-error-document-format-not-supported
+ client-error-document-password-error
+ client-error-document-permission-error
+ client-error-document-security-error
+ client-error-document-unprintable-error
client-error-forbidden
client-error-gone
client-error-ignored-all-notifications
@@ -601,7 +652,7 @@ no notify-subscription-id has been seen.
http://localhost:631/help
-Copyright 2007-2011 by Apple Inc.
+Copyright 2007-2012 by Apple Inc.