-
Notifications
You must be signed in to change notification settings - Fork 13.8k
std::net: update tcp deferaccept delay type to Duration. #140482
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
base: master
Are you sure you want to change the base?
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This comment has been minimized.
This comment has been minimized.
b1c90c8
to
82a0b2a
Compare
This comment has been minimized.
This comment has been minimized.
82a0b2a
to
7a84725
Compare
This comment has been minimized.
This comment has been minimized.
7a84725
to
7cea902
Compare
r? libs for the (unstable) API change. |
r? libs-api |
7cea902
to
dafdcfa
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
dafdcfa
to
c0c9afe
Compare
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.
Apart from the nit the implementation looks good to me. I'm nominating this for libs-api to discuss the overflow behaviour. It might arguably be better to use a saturating conversion on the seconds – deferring the ACK for less time than given is not really an error.
@rustbot label +I-libs-api-nominated
c0c9afe
to
a1096c6
Compare
We discussed this in the @rust-lang/libs-api meeting again. The duration should be explicitly documented as the maximum duration to defer. This allows us to round it down as needed to address OS limitations. Therefore we shouldn't trigger an error for overflows and should instead just use |
/// | ||
/// The `accept` argument set the delay in seconds until the | ||
/// data is available to read, reducing the number of short lived | ||
/// connections without data to process. |
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.
This still says "the delay in seconds".
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
@rustbot ready |
fn set_deferaccept(&self, accept: u32) -> io::Result<()>; | ||
fn set_deferaccept(&self, accept: Duration) -> io::Result<()>; | ||
|
||
/// Gets the accept delay value (in seconds) of the `TCP_DEFER_ACCEPT` option. |
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.
/// Gets the accept delay value (in seconds) of the `TCP_DEFER_ACCEPT` option. | |
/// Gets the accept delay value of the `TCP_DEFER_ACCEPT` option. |
13f8c1d
to
05fecb3
Compare
See comment here.