Skip to content

Commit 937ab4e

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 bad41a5 commit 937ab4e

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
@@ -1514,8 +1514,6 @@ add_job(cupsd_client_t *con, /* I - Client connection */
15141514
ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled");
15151515
}
15161516

1517-
attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
1518-
15191517
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
15201518
{
15211519
send_ipp_status(con, IPP_INTERNAL_ERROR,
@@ -1524,8 +1522,19 @@ add_job(cupsd_client_t *con, /* I - Client connection */
15241522
return (NULL);
15251523
}
15261524

1527-
if (ippGetBoolean(ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN), 0))
1528-
job->print_as_raster = 1;
1525+
if ((attr = ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN)) != NULL)
1526+
{
1527+
if (ippGetBoolean(attr, 0))
1528+
job->print_as_raster = 1;
1529+
}
1530+
else
1531+
{
1532+
if (cupsGetOption("print-as-raster", printer->num_options,
1533+
printer->options) != NULL)
1534+
job->print_as_raster = 1;
1535+
}
1536+
1537+
attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
15291538

15301539
job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
15311540
job->attrs = con->request;

0 commit comments

Comments
 (0)