- /*
- * Build an IPP request, which requires the following
- * attributes:
- *
- * attributes-charset
- * attributes-natural-language
- * printer-uri + job-id *or* job-uri
- * [requesting-user-name]
- */
-
- request = ippNewRequest(op);
-
- if (dest)
- {
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
- "localhost", 0, "/printers/%s", dest);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
- "printer-uri", NULL, uri);
- ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
- job_id);
- }
- else
- {
- sprintf(uri, "ipp://localhost/jobs/%d", job_id);
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL,
- uri);
- }
-
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
- "requesting-user-name", NULL, cupsUser());
-
- /*
- * Do the request and get back a response...
- */
-
- if (op == IPP_PURGE_JOBS)
- response = cupsDoRequest(http, request, "/admin/");
- else
- response = cupsDoRequest(http, request, "/jobs/");
-
- ippDelete(response);
-
- if (cupsLastError() > IPP_OK_CONFLICT)