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

Expose more options, avoid descriptor exhaustion crashes, improve documentation #22

Merged
merged 12 commits into from
Mar 22, 2023

Conversation

termermc
Copy link
Contributor

I've exposed more options to the user via compile time consts that can be defined by the user, and I've also improved documentation in various areas that were bare.

I've also wrapped acceptClient in a try...except that ignores descriptor exhaustion errors, which fixes the ability for anyone to overload the server with connections and crash it.

Additionally, serverInfo has been renamed to httpxServerName (but the old constant still works), and defining it as empty will omit it from the HTTP response. Some users may not want to expose which HTTP server they're using to serve requests, and I think this would be a good thing to have as an option.

@termermc
Copy link
Contributor Author

The bit that handles descriptor exhaustion is related to issue #21, which I had replied to via email but apparently never appeared on GitHub. Sorry about that.

If you have any thoughts, I'd love to hear them. Otherwise, my changes are pretty minimal.

src/httpx.nim Outdated Show resolved Hide resolved
src/httpx.nim Outdated Show resolved Hide resolved
Copy link
Owner

@ringabout ringabout left a comment

Choose a reason for hiding this comment

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

Nice work!

@termermc
Copy link
Contributor Author

Thanks! Happy to help

@termermc termermc closed this Mar 22, 2023
@ringabout ringabout merged commit 4bf9e59 into ringabout:master Mar 22, 2023
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