all: use BACKEND_CUPS_RETRY_CURRENT for memory allocation failures.

This commit is contained in:
Solomon Peachy 2018-02-16 10:49:21 -05:00
parent 0cfd77ce12
commit c824c549fb
16 changed files with 20 additions and 20 deletions

View File

@ -723,7 +723,7 @@ static int canonselphy_read_parse(void *vctx, int data_fd)
}
if (!ctx->printer) {
ERROR("Error mapping printjob to printer type!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_CANCEL;
}
INFO("%sFile intended for a '%s' printer\n", ctx->bw_mode? "B/W " : "", ctx->printer->model);
@ -773,7 +773,7 @@ static int canonselphy_read_parse(void *vctx, int data_fd)
if (!ctx->plane_y || !ctx->plane_m || !ctx->plane_c || !ctx->header ||
(ctx->printer->foot_length && !ctx->footer)) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Move over chunks already read in */

View File

@ -256,7 +256,7 @@ static int selphyneo_read_parse(void *vctx, int data_fd)
ctx->databuf = malloc(remain + sizeof(hdr));
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Store the read-in header */

View File

@ -359,7 +359,7 @@ static int cw01_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(remain);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_CANCEL;
return CUPS_BACKEND_RETRY_CURRENT;
}
j = 0;

View File

@ -897,7 +897,7 @@ static int dnpds40_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(MAX_PRINTJOB_LEN);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_CANCEL;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Clear everything out */

View File

@ -376,7 +376,7 @@ static int kodak1400_read_parse(void *vctx, int data_fd) {
ctx->plane_b = malloc(ctx->hdr.planesize);
if (!ctx->plane_r || !ctx->plane_g || !ctx->plane_b) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
for (i = 0 ; i < ctx->hdr.rows ; i++) {
int j;

View File

@ -311,7 +311,7 @@ static int kodak605_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -1088,7 +1088,7 @@ static int kodak6800_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -553,7 +553,7 @@ static int magicard_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(MAX_PRINTJOB_LEN);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Copy over initial header */
@ -680,7 +680,7 @@ static int magicard_read_parse(void *vctx, int data_fd) {
uint8_t *srcbuf = malloc(MAX_PRINTJOB_LEN);
if (!srcbuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
memcpy(srcbuf, initial_buf + buf_offset, srcbuf_offset);

View File

@ -985,7 +985,7 @@ repeat:
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
memcpy(ctx->databuf + ctx->datalen, &mhdr, sizeof(mhdr));
@ -1014,7 +1014,7 @@ repeat:
spoolbuflen = 0; spoolbuf = malloc(remain);
if (!spoolbuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Read in the BGR data */
@ -1034,7 +1034,7 @@ repeat:
uint8_t *buf = malloc(LUT_LEN);
if (!buf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
if (ctx->Get3DColorTable(buf, ctx->lutfname)) {
ERROR("Unable to open LUT file '%s'\n", ctx->lutfname);

View File

@ -409,7 +409,7 @@ hdr_done:
ctx->databuf = malloc(remain);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Back off the data to read if the backend generates the matte data internally */

View File

@ -243,7 +243,7 @@ top:
ctx->databuf = malloc(remain);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
/* Read it in */

View File

@ -1357,7 +1357,7 @@ static int shinkos1245_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -1472,7 +1472,7 @@ static int shinkos2145_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -2115,7 +2115,7 @@ static int shinkos6145_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -1572,7 +1572,7 @@ static int shinkos6245_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(ctx->datalen);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
{

View File

@ -121,7 +121,7 @@ static int updr150_read_parse(void *vctx, int data_fd) {
ctx->databuf = malloc(MAX_PRINTJOB_LEN);
if (!ctx->databuf) {
ERROR("Memory allocation failure!\n");
return CUPS_BACKEND_FAILED;
return CUPS_BACKEND_RETRY_CURRENT;
}
while(run) {