mitsu70x: Fix a major regression introduced in a047969950

Two bugs canceled each other out; when the first was fixed, the second
(long present) bug expressed itself.
This commit is contained in:
Solomon Peachy 2024-03-17 16:07:33 -04:00
parent 9a4af3ce3e
commit ee741aa9f6
1 changed files with 7 additions and 23 deletions

View File

@ -2076,30 +2076,14 @@ top:
sizeof(struct mitsu70x_hdr))))
return CUPS_BACKEND_FAILED;
if (ctx->lib.dl_handle && !job->raw_format) {
if (ctx->lib.SendImageData(&ctx->output, ctx, d70_library_callback))
/* Library handles sending data -- in REVERSE row order! */
if (ctx->lib.SendImageData(&ctx->output, ctx, d70_library_callback))
return CUPS_BACKEND_FAILED;
if (job->matte)
if (d70_library_callback(ctx, job->databuf + job->datalen - job->matte, job->matte))
return CUPS_BACKEND_FAILED;
if (job->matte)
if (d70_library_callback(ctx, job->databuf + job->datalen - job->matte, job->matte))
return CUPS_BACKEND_FAILED;
} else { // Fallback code..
/* K60 and 305 need data sent in 256K chunks, but the first
chunk needs to subtract the length of the 512-byte header */
int chunk = CHUNK_LEN - sizeof(struct mitsu70x_hdr);
int sent = 512;
while (chunk > 0) {
if ((ret = send_data(ctx->conn,
job->databuf + sent, chunk)))
return CUPS_BACKEND_FAILED;
sent += chunk;
chunk = job->datalen - sent;
if (chunk > CHUNK_LEN)
chunk = CHUNK_LEN;
}
}
/* Then wait for completion, if so desired.. */
INFO("Waiting for printer to acknowledge completion\n");
@ -2619,7 +2603,7 @@ static const char *mitsu70x_prefixes[] = {
/* Exported */
const struct dyesub_backend mitsu70x_backend = {
.name = "Mitsubishi CP-D70 family",
.version = "0.110" " (lib " LIBMITSU_VER ")",
.version = "0.111" " (lib " LIBMITSU_VER ")",
.flags = BACKEND_FLAG_DUMMYPRINT,
.uri_prefixes = mitsu70x_prefixes,
.cmdline_usage = mitsu70x_cmdline,