- Relay printer-state-message values in the IPP backend (STR #2109).

This commit is contained in:
Tim Waugh 2007-04-03 10:08:56 +00:00
parent adb12ec772
commit 7d79ceb63b
2 changed files with 61 additions and 1 deletions

55
cups-str2109.patch Normal file
View File

@ -0,0 +1,55 @@
--- cups-1.2.10/backend/ipp.c.str2109 2007-04-03 11:05:13.000000000 +0100
+++ cups-1.2.10/backend/ipp.c 2007-04-03 11:05:33.000000000 +0100
@@ -210,6 +210,7 @@
"document-format-supported",
"printer-is-accepting-jobs",
"printer-state",
+ "printer-state-message",
"printer-state-reasons",
};
static const char * const jattrs[] =
@@ -1285,6 +1286,11 @@
{
ipp_t *request, /* IPP request */
*response; /* IPP response */
+ static const char * const attrs[] = /* Attributes we want */
+ {
+ "printer-state-message",
+ "printer-state-reasons"
+ };
/*
@@ -1301,8 +1307,9 @@
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
- "requested-attributes", NULL, "printer-state-reasons");
+ ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+ "requested-attributes",
+ (int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs);
/*
* Do the request...
@@ -1430,7 +1437,8 @@
{
int i; /* Looping var */
int count; /* Count of reasons shown... */
- ipp_attribute_t *reasons; /* printer-state-reasons */
+ ipp_attribute_t *psm, /* pritner-state-message */
+ *reasons; /* printer-state-reasons */
const char *reason; /* Current reason */
const char *message; /* Message to show */
char unknown[1024]; /* Unknown message string */
@@ -1438,6 +1446,10 @@
char state[1024]; /* State string */
+ if ((psm = ippFindAttribute(ipp, "printer-state-message",
+ IPP_TAG_TEXT)) != NULL)
+ fprintf(stderr, "INFO: %s\n", psm->values[0].string.text);
+
if ((reasons = ippFindAttribute(ipp, "printer-state-reasons",
IPP_TAG_KEYWORD)) == NULL)
return (0);

View File

@ -6,7 +6,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.2.10
Release: 3%{?dist}
Release: 4%{?dist}
License: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@ -45,6 +45,7 @@ Patch20: cups-getpass.patch
Patch21: cups-driverd-timeout.patch
Patch22: cups-af_unix-auth.patch
Patch23: cups-str2323.patch
Patch24: cups-str2109.patch
Patch100: cups-lspp.patch
Epoch: 1
Url: http://www.cups.org/
@ -152,6 +153,7 @@ lpd emulation.
%patch21 -p1 -b .driverd-timeout
%patch22 -p1 -b .af_unix-auth
%patch23 -p1 -b .str2323
%patch24 -p1 -b .str2109
%if %lspp
%patch100 -p1 -b .lspp
@ -438,6 +440,9 @@ rm -rf $RPM_BUILD_ROOT
%{cups_serverbin}/daemon/cups-lpd
%changelog
* Tue Apr 3 2007 Tim Waugh <twaugh@redhat.com> 1:1.2.10-4
- Relay printer-state-message values in the IPP backend (STR #2109).
* Mon Apr 2 2007 Tim Waugh <twaugh@redhat.com> 1:1.2.10-3
- Don't clear printer-state-reasons after job completion (STR #2323).