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

tarpit feature #8

Open
kirinrastogi opened this issue Jul 20, 2019 · 0 comments
Open

tarpit feature #8

kirinrastogi opened this issue Jul 20, 2019 · 0 comments

Comments

@kirinrastogi
Copy link
Contributor

kirinrastogi commented Jul 20, 2019

Add a nonblocking tarpit. A tarpit is a way to slow down requests responses to stop bots from sending requests so frequently, it cannot consume extra capacity by sleeping.

The challenge here is to not close the sockets after they go out of scope in the epoll iteration loop. I need to figure out rust lifetimes to borrow them in the tarpit data structure until they are removed & responded to.

The drop fn that gets called at the end of the TcpStream lifetime calls close on the socket's file descriptor, so I need to use lifetime specifiers to prevent this.

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

No branches or pull requests

1 participant