Michael R Sweet [Sun, 10 Sep 2023 22:48:17 +0000 (18:48 -0400)]
Add new array APIs, remove old private array header, update unit tests, update
ippfind to use new array and DNS-SD APIs, update other code as needed to not
use deprecated APIs.
scheduler/job.c: Fix extensive logging in scheduler
Based on currently unknown trigger scheduler sometimes sets JobHistoryUpdate into past, which causes select() to timeout after one second.
It happens when job->file_time of a job without files to remove gets assigned to JobHistoryUpdate. If we check for job->num_files and assign the job->file_time only if there are any, we will fix extensive logging (and unneeded cupsd execution) in various places, e.g. cleaning jobs, expiring subscriptions, deleting temporary queues...
scheduler/job.c: Fix extensive logging in scheduler
Based on currently unknown trigger scheduler sometimes sets
JobHistoryUpdate into past, which causes `select()` to timeout after one
second.
It happens when `job->file_time` of a job without files to remove gets
assigned to `JobHistoryUpdate`. If we check for `job->num_files` and
assign the `job->file_time` only if there are any, we will fix extensive
logging (and unneeded cupsd execution) in various places, e.g. cleaning
jobs, expiring subscriptions, deleting temporary queues...
Bryan Mason [Tue, 27 Jun 2023 11:18:46 +0000 (04:18 -0700)]
Use "purge-job" instead of "purge-jobs" when canceling a single job (#742)
The command "cancel -x <job>" adds "purge-jobs true" to the Cancel-Job
operation; however, the correct attribute to use for Cancel-job is
"purge-job" (singular), not "purge-jobs" (plural). As a result, job
files are not removed from /var/spool/cups when "cancel -x <job>" is
executed.
This patch resolves the issue by adding "purge-job" when the IPP
operation is Cancel-Job and "purge-jobs" for other IPP operations
(Purge-Jobs, Cancel-Jobs, and Cancel-My-Jobs)
zdohnal [Mon, 26 Jun 2023 14:24:33 +0000 (16:24 +0200)]
Fix delays in printing to lpd when reserved ports are exhausted (Issue #741)
We use our internal implementation for BSD resvport() by default in LPD backend, which should act on port ranges 512 - 1023, however we didn't go back to the highest port number once we got under the lowest port number. This caused a delay 511s long until `lpd_queue()` got the port number to 0, which triggered the assignment of the highest port number.
The highest port number is assigned right after we cross the lowest port number, which eliminates this kind of delay.
Bryan Mason [Sat, 24 Jun 2023 19:31:23 +0000 (12:31 -0700)]
Fix delays printing to lpd when reserved ports are exhausted
cups_rresvport() doesn't reserve ports less than 512; however,
lpd_queue() continues decrementing the port number to 0. This leads
to delays of ~511 seconds once all ports between 512-1023 are
exhausted. Even when ports become available, lpd_queue() still tries
calling cups_rresvport() with port numbers less than 512, waiting one
second between each call.
Zdenek Dohnal [Wed, 14 Jun 2023 07:55:33 +0000 (09:55 +0200)]
cups/ppd-cache.c: Put cupsSingleFile into generated PPD
Some printers are not able to print multiple files in one job via IPP
Everywhere. Adding the PPD keyword enables the feature on all printers
in exchange for performance degradation (there is a 1-2s pause between
printed files).
Rose [Sun, 11 Jun 2023 20:09:53 +0000 (16:09 -0400)]
Regression: Certificate data is corrupted during base64 conversion
The bug during which certificates become corrupt was introduced in a521b235a1abc008cb0b2f490a765bb31e2ec14b. It turns out some data was not being truncated after being promoted to an integer, causing 1s to be ORed into the index number when they should not have been.
I only intended to remove the & 255 from the other side, where the & 63 would have rendered that operation redundant.
I apologize for this error. I made the appropriate changes I intended to make in this new PR.
Zdenek Dohnal [Tue, 6 Jun 2023 08:45:37 +0000 (10:45 +0200)]
dest.c: Call cupsEnumDests() only if data.name is not NULL (fixes #719)
Fixes regression created by #452 - in case there is no default
destination and `cupsGetNamedDest()` is called to get one (by calling it
with argument `name` as NULL), the function crashes.
It happens because we try to look for the default printer on the network
(where we access `data.name`, which is NULL, in callback), but we never
found out the printer's name.
Zdenek Dohnal [Thu, 1 Jun 2023 12:47:49 +0000 (14:47 +0200)]
CI: Fix i386 for now
Although Ubuntu is dropping support for i386, this PR fixes build i386
for now. However we have to remove image upgrade, so probably once there
is a new image, i386 will be broken again.
I would remove the job for i386 once it breaks again due removing
support for i386 in Ubuntu.
Zdenek Dohnal [Tue, 30 May 2023 12:57:46 +0000 (14:57 +0200)]
workflows.yaml: Fix Github Actions on i386
- build i386 was failing due missing dependencies - libgcc-s1:i386 and
libstdc++6:i386
- use ubuntu-latest, so we automatically use the latest stable, but
print out the pretty name in workflow to show which version it is
(dont wanna to look up the names :))
- update the image before testing
Nathan Muggli [Fri, 26 May 2023 18:36:45 +0000 (12:36 -0600)]
Add custom page size values to media-col-database
When creating the IPP attrs based on the PPD file, if the PPD file
supports custom page sizes update our media-col-database to contain a
media-size attr with the min/max range.
Bryan Cain [Fri, 12 May 2023 17:23:24 +0000 (11:23 -0600)]
Fix duplicate PPD->IPP media-type name mappings
If more than one MediaType in a PPD matched the pattern for a registered
PWG media-type name, they would all be mapped to that name, making it
impossible for a client using CUPS' IPP interface to distinguish between
them or specify a particular one.
This comes up with Epson-provided PPDs, which frequently hit this case
by combining print quality with media type like so:
*MediaType PLAIN_HIGH/Plain paper-High: "
*MediaType PLAIN_NORMAL/Plain paper-Standard: "
Solve this problem by not assigning the standard PWG name to either one
when such duplication occurs.