]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Expand whitelist for use of "offline-report" 264/head
authorSolomon Peachy <pizza@shaftnet.org>
Thu, 30 Sep 2021 11:25:46 +0000 (07:25 -0400)
committerSolomon Peachy <pizza@shaftnet.org>
Thu, 30 Sep 2021 11:51:02 +0000 (07:51 -0400)
The old behavior unconditionally cleared the "offline-report"
printer-reason unless the backend was 'usb:' or 'ippusb:' with the
assumption that these were the only two direct-connect USB backends
in use, with everything else being remote.

This is definitely not the case; putting aside proprietary 3rd-party
backends, there is Gutenprint's USB backend, which identifies itself
with 'gutenprint52+usb:' or 'gutenprint53+usb:' depending on the version.

So, generalize the rule to search for the string 'usb:' in the uri
instead, which will allow all three/four usb backends to use the
'offline-report' printer-reason.

(FWIW, I'm not happy with this approach; It seems to me that the
 CorrectSolution(tm) is to track the device-class returned by the backend
 at discovery time, and ignore 'offline-report' for anything other than
 'direct', but that's going to be a lot more involved..)

scheduler/job.c

index b448acda5fec7dc35673b727f9991cd5c08d21d0..fd69f71c9c6757f8a4a3a238284cef5f506d34b9 100644 (file)
@@ -3115,8 +3115,7 @@ finalize_job(cupsd_job_t *job,            /* I - Job */
   * rarely have current information for network devices...
   */
 
-  if (strncmp(job->printer->device_uri, "usb:", 4) &&
-      strncmp(job->printer->device_uri, "ippusb:", 7))
+  if (!strstr(job->printer->device_uri, "usb:"))
     cupsdSetPrinterReasons(job->printer, "-offline-report");
 
  /*