Skip to content

Fix delays printing to lpd when reserved ports are exhausted#741

Merged
zdohnal merged 1 commit intoOpenPrinting:masterfrom
bmasonrh:master
Jun 26, 2023
Merged

Fix delays printing to lpd when reserved ports are exhausted#741
zdohnal merged 1 commit intoOpenPrinting:masterfrom
bmasonrh:master

Conversation

@bmasonrh
Copy link
Contributor

@bmasonrh bmasonrh commented Jun 24, 2023

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.

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.
Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - port range for old BSD resvport() is 512-1023, so we should reassign lport to the highest value again once we got under the lowest limit to prevent delays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants