/*
- * "$Id: ipp.c 5907 2006-08-30 02:18:28Z mike $"
+ * "$Id: ipp.c 5970 2006-09-19 20:11:08Z mike $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
if (con->http.version == HTTP_1_1)
{
- httpPrintf(HTTP(con), "Transfer-Encoding: chunked\r\n\r\n");
- cupsdFlushHeader(con);
+ if (httpPrintf(HTTP(con), "Transfer-Encoding: chunked\r\n\r\n") < 0)
+ return (0);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.data_encoding = HTTP_ENCODE_CHUNKED;
}
length = ippLength(con->response);
- httpPrintf(HTTP(con), "Content-Length: " CUPS_LLFMT "\r\n\r\n",
- CUPS_LLCAST length);
- cupsdFlushHeader(con);
+ if (httpPrintf(HTTP(con), "Content-Length: " CUPS_LLFMT "\r\n\r\n",
+ CUPS_LLCAST length) < 0)
+ return (0);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.data_encoding = HTTP_ENCODE_LENGTH;
con->http.data_remaining = length;
if (!compressions || !filetypes)
{
- cupsdCancelJob(job, 1);
+ cupsdCancelJob(job, 1, IPP_JOB_ABORTED);
send_ipp_status(con, IPP_INTERNAL_ERROR,
_("Unable to allocate memory for file types!"));
* Cancel the job and return...
*/
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled by \"%s\".", username);
-
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_CANCELED);
cupsdCheckJobs();
cupsdLogMessage(CUPSD_LOG_INFO, "Job %d was canceled by \"%s\".", jobid,
cupsdLoadJob(job);
- if (!job->attrs ||job->num_files == 0)
+ if (!job->attrs || job->num_files == 0)
{
/*
* Nope - return a "not possible" error...
return;
}
else if (con->response->request.status.status_code == IPP_OK)
- {
- cupsdCancelJob(job, 0);
-
- if (JobHistory)
- {
- job->state->values[0].integer = attr->values[0].integer;
- job->state_value = (ipp_jstate_t)attr->values[0].integer;
- cupsdSaveJob(job);
- }
- }
+ cupsdCancelJob(job, 0, (ipp_jstate_t)attr->values[0].integer);
break;
}
}
/*
- * End of "$Id: ipp.c 5907 2006-08-30 02:18:28Z mike $".
+ * End of "$Id: ipp.c 5970 2006-09-19 20:11:08Z mike $".
*/