Index: berkeley/lpq.c =================================================================== --- berkeley/lpq.c (revision 8924) +++ berkeley/lpq.c (working copy) @@ -340,8 +340,19 @@ char resource[1024]; /* Resource string */ char rankstr[255]; /* Rank string */ char namestr[1024]; /* Job name string */ - static const char *ranks[10] = /* Ranking strings */ + static const char * const jobattrs[] =/* Job attributes we want to see */ { + "copies", + "job-id", + "job-k-octets", + "job-name", + "job-originating-user-name", + "job-printer-uri", + "job-priority", + "job-state" + }; + static const char * const ranks[10] = /* Ranking strings */ + { "th", "st", "nd", @@ -368,6 +379,7 @@ * attributes-charset * attributes-natural-language * job-uri or printer-uri + * requested-attributes */ request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS); @@ -397,6 +409,10 @@ ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1); } + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", + (int)(sizeof(jobattrs) / sizeof(jobattrs[0])), NULL, jobattrs); + /* * Do the request and get back a response... */ Index: systemv/lpstat.c =================================================================== --- systemv/lpstat.c (revision 8924) +++ systemv/lpstat.c (working copy) @@ -1287,10 +1287,10 @@ "job-id", "job-k-octets", "job-name", - "time-at-creation", + "job-originating-user-name", "job-printer-uri", - "job-originating-user-name", - "job-state-reasons" + "job-state-reasons", + "time-at-creation" }; Index: cups/util.c =================================================================== --- cups/util.c (revision 8925) +++ cups/util.c (working copy) @@ -570,17 +570,17 @@ _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ static const char * const attrs[] = /* Requested attributes */ { + "document-format", "job-id", + "job-k-octets", + "job-name", + "job-originating-user-name", + "job-printer-uri", "job-priority", - "job-k-octets", "job-state", "time-at-completed", "time-at-creation", - "time-at-processing", - "job-printer-uri", - "document-format", - "job-name", - "job-originating-user-name" + "time-at-processing" }; Index: test/4.3-job-ops.test =================================================================== --- test/4.3-job-ops.test (revision 8924) +++ test/4.3-job-ops.test (working copy) @@ -296,6 +296,7 @@ # What attributes do we expect? EXPECT attributes-charset EXPECT attributes-natural-language + EXPECT !job-printer-uri } { # The name of the test... @@ -310,6 +311,7 @@ ATTR charset attributes-charset utf-8 ATTR language attributes-natural-language en ATTR uri printer-uri $scheme://$hostname:$port/ + ATTR keyword requested-attributes all # What statuses are OK? STATUS successful-ok @@ -320,6 +322,7 @@ EXPECT job-uri EXPECT job-id EXPECT job-state + EXPECT job-printer-uri } # Index: test/ipptest.c =================================================================== --- test/ipptest.c (revision 8924) +++ test/ipptest.c (working copy) @@ -47,6 +47,7 @@ typedef struct _cups_expect_s /**** Expected attribute info ****/ { + int not_expect; /* Don't expect attribute? */ char *name, /* Attribute name */ *of_type, /* Type name */ *same_count_as, /* Parallel attribute name */ @@ -600,7 +601,17 @@ last_expect = expects + num_expects; num_expects ++; - last_expect->name = strdup(token); + if (token[0] == '!') + { + last_expect->not_expect = 1; + last_expect->name = strdup(token + 1); + } + else + { + last_expect->not_expect = 0; + last_expect->name = strdup(token); + } + last_expect->of_type = NULL; last_expect->same_count_as = NULL; last_expect->if_defined = NULL; @@ -769,13 +780,14 @@ found = ippFindAttribute(response, expect->name, IPP_TAG_ZERO); - if (!found || !expect_matches(expect, found->value_tag)) + if ((found == NULL) != expect->not_expect || + (found && !expect_matches(expect, found->value_tag))) { pass = 0; break; } - if (expect->same_count_as) + if (found && expect->same_count_as) { attrptr = ippFindAttribute(response, expect->same_count_as, IPP_TAG_ZERO); @@ -851,27 +863,35 @@ found = ippFindAttribute(response, expect->name, IPP_TAG_ZERO); - if (!found) - printf(" EXPECTED: %s\n", expect->name); - else if (!expect_matches(expect, found->value_tag)) - printf(" EXPECTED: %s of type %s but got %s\n", - expect->name, expect->of_type, - ippTagString(found->value_tag)); - else if (expect->same_count_as) + if ((found == NULL) != expect->not_expect) { - attrptr = ippFindAttribute(response, expect->same_count_as, - IPP_TAG_ZERO); - - if (!attrptr) - printf(" EXPECTED: %s (%d values) same count as %s " - "(not returned)\n", - expect->name, found->num_values, expect->same_count_as); - else if (attrptr->num_values != found->num_values) - printf(" EXPECTED: %s (%d values) same count as %s " - "(%d values)\n", - expect->name, found->num_values, expect->same_count_as, - attrptr->num_values); - } + if (expect->not_expect) + printf(" NOT EXPECTED: %s\n", expect->name); + else + printf(" EXPECTED: %s\n", expect->name); + } + else if (found) + { + if (!expect_matches(expect, found->value_tag)) + printf(" EXPECTED: %s of type %s but got %s\n", + expect->name, expect->of_type, + ippTagString(found->value_tag)); + else if (expect->same_count_as) + { + attrptr = ippFindAttribute(response, expect->same_count_as, + IPP_TAG_ZERO); + + if (!attrptr) + printf(" EXPECTED: %s (%d values) same count as %s " + "(not returned)\n", + expect->name, found->num_values, expect->same_count_as); + else if (attrptr->num_values != found->num_values) + printf(" EXPECTED: %s (%d values) same count as %s " + "(%d values)\n", + expect->name, found->num_values, expect->same_count_as, + attrptr->num_values); + } + } } for (attrptr = response->attrs; attrptr != NULL; attrptr = attrptr->next) Index: scheduler/ipp.c =================================================================== --- scheduler/ipp.c (revision 8926) +++ scheduler/ipp.c (working copy) @@ -6999,8 +6999,19 @@ else username[0] = '\0'; - ra = create_requested_array(con->request); + if ((ra = create_requested_array(con->request)) == NULL && + !ippFindAttribute(con->request, "requested-attributes", IPP_TAG_KEYWORD)) + { + /* + * IPP conformance - Get-Jobs has a default requested-attributes value of + * "job-id" and "job-uri". + */ + ra = cupsArrayNew((cups_array_func_t)strcmp, NULL); + cupsArrayAdd(ra, "job-id"); + cupsArrayAdd(ra, "job-uri"); + } + /* * OK, build a list of jobs for this printer... */ Index: scheduler/job.c =================================================================== --- scheduler/job.c (revision 8924) +++ scheduler/job.c (working copy) @@ -2441,7 +2441,7 @@ * Finalize the job immediately if we forced things... */ - if (action >= CUPSD_JOB_FORCE) + if (action >= CUPSD_JOB_FORCE && job->printer) finalize_job(job, 0); /*