From 293136c04b7eb5293ef18273e13fca00c85bb5f0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 19 Oct 2004 17:05:01 +0000 Subject: r3067: patch based on volker's initial work in trunk that fixes the queu update problem when using the background daemon (This used to be commit de7af09e727e744aa27af85ef7c0f73ed5c1550a) --- source3/printing/print_cups.c | 55 +++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 31 deletions(-) (limited to 'source3/printing/print_cups.c') diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index 3097811fac..ad01a68c8e 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -26,31 +26,6 @@ #include -/* - * CUPS printing interface definitions... - */ - -static int cups_job_delete(int snum, struct printjob *pjob); -static int cups_job_pause(int snum, struct printjob *pjob); -static int cups_job_resume(int snum, struct printjob *pjob); -static int cups_job_submit(int snum, struct printjob *pjob); -static int cups_queue_get(int snum, print_queue_struct **q, - print_status_struct *status); -static int cups_queue_pause(int snum); -static int cups_queue_resume(int snum); - - -struct printif cups_printif = - { - cups_queue_get, - cups_queue_pause, - cups_queue_resume, - cups_job_delete, - cups_job_pause, - cups_job_resume, - cups_job_submit, - }; - /* * 'cups_passwd_cb()' - The CUPS password callback... */ @@ -811,7 +786,11 @@ cups_job_submit(int snum, struct printjob *pjob) */ static int -cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) +cups_queue_get(const char *printer_name, + enum printing_types printing_type, + char *lpq_command, + print_queue_struct **q, + print_status_struct *status) { http_t *http; /* HTTP connection to server */ ipp_t *request, /* IPP Request */ @@ -847,7 +826,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) }; - DEBUG(5,("cups_queue_get(%d, %p, %p)\n", snum, q, status)); + DEBUG(5,("cups_queue_get(%s, %p, %p)\n", printer_name, q, status)); /* * Make sure we don't ask for passwords... @@ -870,8 +849,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) * Generate the printer URI... */ - slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", - PRINTERNAME(snum)); + slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", printer_name); /* * Build an IPP_GET_JOBS request, which requires the following @@ -1090,7 +1068,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) if ((response = cupsDoRequest(http, request, "/")) == NULL) { - DEBUG(0,("Unable to get printer status for %s - %s\n", PRINTERNAME(snum), + DEBUG(0,("Unable to get printer status for %s - %s\n", printer_name, ippErrorString(cupsLastError()))); httpClose(http); *q = queue; @@ -1099,7 +1077,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) if (response->request.status.status_code >= IPP_OK_CONFLICT) { - DEBUG(0,("Unable to get printer status for %s - %s\n", PRINTERNAME(snum), + DEBUG(0,("Unable to get printer status for %s - %s\n", printer_name, ippErrorString(response->request.status.status_code))); ippDelete(response); httpClose(http); @@ -1319,6 +1297,21 @@ cups_queue_resume(int snum) return (ret); } +/******************************************************************* + * CUPS printing interface definitions... + ******************************************************************/ + +struct printif cups_printif = +{ + PRINT_CUPS, + cups_queue_get, + cups_queue_pause, + cups_queue_resume, + cups_job_delete, + cups_job_pause, + cups_job_resume, + cups_job_submit, +}; #else /* this keeps fussy compilers happy */ -- cgit