-
Notifications
You must be signed in to change notification settings - Fork 172
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
Reject overflowing connection with status code 429 #456
Conversation
server.send_response(&reject).await?; | ||
|
||
return Err(error); | ||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does Ok(())
vs Err(error)
imply here?
I suppose we don't have any error for it in Incoming
and return Ok(())
is probably fine because it's already logged once the connection limit is exceeded when Handshake::Reject
is detected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, returning 429 rejection isn't an error here, it's expected behavior (but we can still get an io error when sending the response for whatever reason).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a couple of questions :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, modulo possibly the name, up to you @maciejhirsz.
Addresses #398.
Needs an extra PR in soketto to add the
Retry-After
header, although I think this might be a case of perfect is the enemy of good here.