Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 26, 2023

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