Skip to content

Commit 88fc6ed

Browse files
committed
scheduler: Fix applying print-as-raster default
Currently, the default was applied only when present in the request, which is how `lp` behaves. However the application does not have to include defaults in the request, so we have to apply it in scheduler. Additionally, this covers a case when print-as-raster is set by default, but we want to disable it in a specific request.
1 parent c982fe6 commit 88fc6ed

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

scheduler/ipp.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,8 +1507,6 @@ add_job(cupsd_client_t *con, /* I - Client connection */
15071507
ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled");
15081508
}
15091509

1510-
attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
1511-
15121510
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
15131511
{
15141512
send_ipp_status(con, IPP_STATUS_ERROR_INTERNAL,
@@ -1517,8 +1515,19 @@ add_job(cupsd_client_t *con, /* I - Client connection */
15171515
return (NULL);
15181516
}
15191517

1520-
if (ippGetBoolean(ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN), 0))
1521-
job->print_as_raster = 1;
1518+
if ((attr = ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN)) != NULL)
1519+
{
1520+
if (ippGetBoolean(attr, 0))
1521+
job->print_as_raster = 1;
1522+
}
1523+
else
1524+
{
1525+
if (cupsGetOption("print-as-raster", printer->num_options,
1526+
printer->options) != NULL)
1527+
job->print_as_raster = 1;
1528+
}
1529+
1530+
attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
15221531

15231532
job->dtype = printer->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
15241533
job->attrs = con->request;

0 commit comments

Comments
 (0)