Commit e174b54b authored by David Valleau's avatar David Valleau Committed by Commit Bot

Fixing bug when sending last_document argument to cupsStartDestDocument

The SendDocument function in cups_printer which calls
cupsStartDestDocument in CUPS had the logic backwards for passing the
"last_document" argument. This was causing CUPS to behave strangely and
mishandle printing multiple copies of documents for printers which did
not support the copies IPP attribute.

Bug: chromium:897275
Test: Tested manually using elm device and virtual USB printer
Change-Id: I313965bfe4c281adf071ef8c14a022df4e0c2c12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695693
Auto-Submit: David Valleau <valleau@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Commit-Queue: David Valleau <valleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676090}
parent be399ad3
...@@ -178,7 +178,7 @@ bool CupsPrinter::StartDocument(int job_id, ...@@ -178,7 +178,7 @@ bool CupsPrinter::StartDocument(int job_id,
http_status_t start_doc_status = http_status_t start_doc_status =
cupsStartDestDocument(cups_http_, destination_.get(), dest_info_.get(), cupsStartDestDocument(cups_http_, destination_.get(), dest_info_.get(),
job_id, document_name.c_str(), CUPS_FORMAT_PDF, job_id, document_name.c_str(), CUPS_FORMAT_PDF,
options.size(), data, last_document ? 0 : 1); options.size(), data, last_document ? 1 : 0);
cupsSetUser(nullptr); // reset to default username ("anonymous") cupsSetUser(nullptr); // reset to default username ("anonymous")
return start_doc_status == HTTP_CONTINUE; return start_doc_status == HTTP_CONTINUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment