giving client-error-not-found message on trying to pause printer
akbar
akbarbasha at tataelxsi.co.in
Fri Jan 29 22:58:20 PST 2010
Hi,
I am trying to pause printer once the current job is arrived,I am failing as my code displaying client-error-not-found message in the console,
My code is below,what I am doing wrong,please give me some suggestion.
case IPP_JOB_PROCESSING:
if (jobId) //job_cancelled &&
/*
* disable a destination...
*/
if (http == NULL)
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr, _("%s: Unable to connect to server: %s\n"), command, strerror(errno));
//return (1);
}
/*
* Build an IPP request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
* printer-state-message [optional]
*/
request = ippNewRequest(IPP_PAUSE_PRINTER);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", argv[i]);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME "requesting-user-name", NULL, cupsUser());
if (reason != NULL)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT,
"printer-state-message", NULL, reason);
/*
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL)
{
if (response->request.status.status_code > IPP_OK_CONFLICT)
{_cupsLangPrintf(stderr, _("%s: Operation failed: %s\n"), command, ippErrorString(cupsLastError()));
//return (1);
}
ippDelete(response);
}
else
{
_cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString());
//return (1);
}
break;
More information about the cups-devel
mailing list