From aae86d2526998cb0f45c1ff428c1cd7eaa23a4a4 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Thu, 7 Jan 2021 10:14:40 +0100 Subject: [PATCH] driverless: Removed the support quality check (cherry picked from commit 3fddcf5cb78a9abc55024804635d29f7ac0d96fb) --- NEWS | 4 ++++ cupsfilters/ipp.h | 8 -------- utils/driverless.c | 45 +++++++++------------------------------------ 3 files changed, 13 insertions(+), 44 deletions(-) diff --git a/NEWS b/NEWS index 4bde3f0e6..4e711f638 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,10 @@ NEWS - OpenPrinting CUPS Filters v1.28.6 - 2020-12-02 CHANGES IN V1.28.7 + - driverless: Removed the support quality check from Pull + request #235 as it takes significant time for each printer + being listed, making cups-driverd (`lpinfo -m`) timing out + when there are many printers (OP CUPS Issue #65). - libcupsfilters: In the PPD generator give priority to Apple Raster against PDF (Issue #331). - libcupsfilters: Added NULL check when removing ".Borderless" diff --git a/cupsfilters/ipp.h b/cupsfilters/ipp.h index 4479c6951..fe3c8edf4 100644 --- a/cupsfilters/ipp.h +++ b/cupsfilters/ipp.h @@ -54,14 +54,6 @@ enum driverless_support_modes { DRVLESS_INCOMPLETEIPP /* Driverless support without media-col-database attribute */ }; -/* Array of text strings explaining available driverless support */ -const char * driverless_support_strs[] = { - "driverless - cannot check driverless status", - "fully driverless", - "driverless via IPP 1.1", - "driverless with incomplete IPP request" -}; - int check_driverless_support(const char* uri); ipp_t *get_printer_attributes(const char* raw_uri, const char* const pattrs[], diff --git a/utils/driverless.c b/utils/driverless.c index 9a9b15f91..55db7eef5 100644 --- a/utils/driverless.c +++ b/utils/driverless.c @@ -63,8 +63,7 @@ convert_to_port(char *a) void listPrintersInArray(int reg_type_no, int mode, int isFax, char* ippfind_output) { - int driverless_support = 0, /*process id for ippfind */ - port, + int port, is_local; char buffer[8192], /* Copy buffer */ *ptr, /* Pointer into string */ @@ -88,7 +87,6 @@ listPrintersInArray(int reg_type_no, int mode, int isFax, make[512], /* Manufacturer */ model[256], /* Model */ pdl[256], /* PDL */ - driverless_info[256], /* Driverless info string */ device_id[2048]; /* 1284 device ID */ service_uri = (char *)malloc(2048*(sizeof(char))); @@ -324,31 +322,6 @@ listPrintersInArray(int reg_type_no, int mode, int isFax, else strncpy(make_and_model, model, sizeof(make_and_model) - 1); - /* Check which driverless support is available for the found device: - * 0) DRVLESS_CHECKERR - the device failed to respond to any - * get-printer-attributes request versions available. - * 1) FULL_DRVLESS - the device responded correctly to IPP 2.0 - * get-printer-attributes request. - * The device is compatible with CUPS 'everywhere' model. - * 2) DRVLESS_IPP11 - the device responded correctly to IPP 1.1 - * get-printer-attributes request. - * 3) DRVLESS_INCOMPLETEIPP - the device responded correctly to IPP - * get-printer-attributes request without media-col-database - * attribute - * - * If we know which driverless support is available, we can divide - * which devices can be supported by CUPS temporary queues and which - * devices need cups-browsed to run. - */ - driverless_support = check_driverless_support(service_uri); - - if (driverless_support == DRVLESS_CHECKERR) - fprintf(stderr, "Failed to get info about driverless support.\n"); - - snprintf(driverless_info, 255, "%s", - driverless_support_strs[driverless_support]); - driverless_info[255] = '\0'; - if (mode == 1) { /* Only output the entry if we had this UUID not already */ if (!txt_uuid[0] || !cupsArrayFind(uuids, txt_uuid)) { @@ -356,25 +329,25 @@ listPrintersInArray(int reg_type_no, int mode, int isFax, is the the same pair of print and fax PPDs */ if (txt_uuid[0]) cupsArrayAdd(uuids, strdup(txt_uuid)); /* Call with "list" argument (PPD generator in list mode) */ - printf("\"%s%s\" en \"%s\" \"%s, %s%s, cups-filters " VERSION - "\" \"%s\"\n", + printf("\"%s%s\" en \"%s\" \"%s, %sdriverless, cups-filters " + VERSION "\" \"%s\"\n", ((isFax) ? "driverless-fax:" : "driverless:"), service_uri, make, make_and_model, ((isFax) ? "Fax, " : ""), - driverless_info, device_id); + device_id); if (resource[0]) /* We have also fax on this device */ - printf("\"%s%s\" en \"%s\" \"%s, Fax, %s, cups-filters " VERSION - "\" \"%s\"\n", + printf("\"%s%s\" en \"%s\" \"%s, Fax, driverless, cups-filters " + VERSION "\" \"%s\"\n", "driverless-fax:", service_uri, make, make_and_model, - driverless_info, device_id); + device_id); } } else { /* Call without arguments and env variable "SOFTWARE" starting with "CUPS" (Backend in discovery mode) */ - printf("network %s \"%s\" \"%s (%s)\" \"%s\" \"\"\n", + printf("network %s \"%s\" \"%s (driverless)\" \"%s\" \"\"\n", service_uri, make_and_model, make_and_model, - driverless_info, device_id); + device_id); } } -- 2.47.3