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

Resize thread pool and set TcpStream timeout #10

Merged
merged 7 commits into from
Nov 15, 2022

Conversation

sigaloid
Copy link
Contributor

This fixes the trivial attack of slowloris'ing 10 threads and holding them open forever.

  1. the thread count is dynamic (up to 400 threads in my example but that's not a hard limit and depends on use case; it also rescales back down based on demand)
  2. the stream is killed after one second (also depends on use case)

Basically just proposing an idea that the thread pool be resized. :)

@sigaloid sigaloid mentioned this pull request Oct 23, 2021
@xvxx xvxx merged commit f4470fa into xvxx:master Nov 15, 2022
@xvxx
Copy link
Owner

xvxx commented Nov 15, 2022

Awesome, thank you!

xvxx added a commit that referenced this pull request Nov 16, 2022
@xvxx
Copy link
Owner

xvxx commented Nov 16, 2022

I had to revert this because I am getting random !! io:Error: Thread timeout (std::io::ErrorKind::WouldBlock) errors now when I run any of the examples or any Vial app. All I have to do is load a page and hit refresh a few times, and it will fail almost right away. Not sure what is happening. I bumped the timeout and removed it and still saw the same issue.

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