]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
cups-browsed.c: Make NotifLeaseDuration configurable and renew after half the lease...
authorzdohnal <zdohnal@redhat.com>
Fri, 18 Jun 2021 10:27:53 +0000 (12:27 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Fri, 18 Jun 2021 10:37:04 +0000 (12:37 +0200)
commitff8aa218366fa93c2ae7ff3672c7e021204a5a62
treecf2db56a754126edddb4d28d36daca87a6b8084d
parent404f570f52dc709c2a9f83db477bf13f318d746a
cups-browsed.c: Make NotifLeaseDuration configurable and renew after half the lease duration not 60 sec before end

1) NotifLeaseDuration directive for cups-browsed.conf - it will make
   lease duration for notifications configurable by users. IMO it is not
   useful for regular users, but it is helpful during sanity testing
   (for verifying that we actually renew the subscription when time
   comes). The current hardcoded 1 day is unusuable for that :( .
   I implemented the lowest threshold to 300s to prevent a possible DoS.
2) Subscription renewal is set to happen in the middle of NotifLeaseDuration,
   not one minute before lease expiration. This was a problem on busy servers,
   where cups-browsed was busy and wasn't able to renew the subscription
   before cupsd removed it. Then if some jobs had come before the subscription
   was created again, the queue got disabled. The proposed approach is based
   on behavior of DHCP.

(cherry picked from commit d90a4fc57b00b4a1f6c196bcb96025251b555dd9)
utils/cups-browsed.c
utils/cups-browsed.conf.5
utils/cups-browsed.conf.in