]> git.ipfire.org Git - thirdparty/cups.git/commit
Changed the end-of-search criteria for ippfind -T 0 1214/head
authorAlexander Pevzner <pzz@apevzner.com>
Sat, 5 Apr 2025 13:08:35 +0000 (16:08 +0300)
committerAlexander Pevzner <pzz@apevzner.com>
Mon, 7 Apr 2025 14:59:50 +0000 (17:59 +0300)
commitf6c032fbacecf1cce7a819b5b8c1a4c26641c63f
treec75a6e70e901e3d9d0b188dfadbddce1dc00961a
parent8ac640ebeb08413460f1d51311911f3ce311df01
Changed the end-of-search criteria for ippfind -T 0

Previously, with the -T 0 option ("search quickly with automatic
timeout"), ippfind used the following criteria to determine when the
search was complete:

  1. At least one service was discovered, and
  2. Either all discovered services were resolved or 2.5 seconds had
     passed since the last update.

However, this algorithm caused unreliable behavior when a mix of devices
was present—some that could be discovered quickly (such as cached or
locally published devices via ipp-usb) and others that required more
time (such as network devices). As a result, ippfind often terminated
prematurely, missing network devices in its output.

The updated end-of-search criteria are as follows:

  1. All discovered services must be either resolved or have at least 1.0
      second since their last update, and
  2. The total discovery time of at least 2.5 seconds has passed.

This updated algorithm significantly improves discovery reliability.
tools/ippfind.c