all: Add some print quantity range checks where we can.
Most backends don't verify against remaining media though.
This commit is contained in:
parent
175f6a52d8
commit
cc87cd1cc3
|
@ -445,7 +445,8 @@ top:
|
|||
free(resp);
|
||||
resp = NULL;
|
||||
|
||||
/* Set print quantity */
|
||||
/* Set print quantity */ // XXX check against remaining print count
|
||||
|
||||
cw01_build_cmd(&cmd, "CNTRL", "QTY", 8);
|
||||
snprintf(buf, sizeof(buf), "%07d\r", copies);
|
||||
ret = cw01_do_cmd(ctx, &cmd, (uint8_t*) buf, 8);
|
||||
|
|
|
@ -795,6 +795,8 @@ static int dnpds40_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
/* Update quantity offset with count */
|
||||
// XXX this breaks if ctx->manual_copies is set, but the job
|
||||
// has a CNTRL QTY != 1
|
||||
if (!ctx->manual_copies && copies > 1) {
|
||||
snprintf(buf, sizeof(buf), "%07d\r", copies);
|
||||
if (ctx->qty_offset) {
|
||||
|
|
|
@ -299,6 +299,8 @@ static int kodak605_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
/* Printer handles generating copies.. */
|
||||
if (copies > 255)
|
||||
copies = 255;
|
||||
if (ctx->hdr.copies < copies)
|
||||
ctx->hdr.copies = copies;
|
||||
|
||||
|
|
|
@ -757,6 +757,8 @@ static int kodak6800_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
/* Printer handles generating copies.. */
|
||||
if (copies > 255) // XXX test against remaining media?
|
||||
copies = 255;
|
||||
if (ctx->hdr.copies < copies)
|
||||
ctx->hdr.copies = copies;
|
||||
|
||||
|
|
|
@ -1436,6 +1436,10 @@ static int shinkos1245_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_HOLD;
|
||||
}
|
||||
|
||||
/* Fix max print count. */
|
||||
if (copies > 9999) // XXX test against remaining media
|
||||
copies = 9999;
|
||||
|
||||
top:
|
||||
if (state != last_state) {
|
||||
if (dyesub_debug)
|
||||
|
|
|
@ -1573,7 +1573,9 @@ static int shinkos2145_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_HOLD;
|
||||
}
|
||||
|
||||
top:
|
||||
// XXX check copies against remaining media!
|
||||
|
||||
top:
|
||||
if (state != last_state) {
|
||||
if (dyesub_debug)
|
||||
DEBUG("last_state %d new %d\n", last_state, state);
|
||||
|
|
|
@ -1762,6 +1762,8 @@ static int shinkos6145_main_loop(void *vctx, int copies) {
|
|||
return CUPS_BACKEND_HOLD;
|
||||
}
|
||||
|
||||
// XXX check copies against remaining media!
|
||||
|
||||
top:
|
||||
if (state != last_state) {
|
||||
if (dyesub_debug)
|
||||
|
|
|
@ -1679,6 +1679,8 @@ static int shinkos6245_main_loop(void *vctx, int copies) {
|
|||
goto printer_error;
|
||||
}
|
||||
|
||||
// XXX check copies against remaining media!
|
||||
|
||||
top:
|
||||
if (state != last_state) {
|
||||
if (dyesub_debug)
|
||||
|
|
Loading…
Reference in a new issue