-
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
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
/// Note that the delay is expressed as Duration from user's perspective | ||
/// the call rounds it down to the nearest second. |
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 is misleading, the "nearest second" might very well be quite a lot smaller than the duration.
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.
how would you phrase it ?
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.
I'd probably just remove the sentence. Alternatively,
/// Note that the delay is expressed as Duration from user's perspective | |
/// the call rounds it down to the nearest second. | |
the call rounds it down to the nearest second expressible as a [`c_int`]. |
05fecb3
to
c414a42
Compare
This comment has been minimized.
This comment has been minimized.
c414a42
to
c0de794
Compare
Great, thank you! |
…n, r=joboet std::net: update tcp deferaccept delay type to Duration. See comment [here](rust-lang#119639 (comment)).
Rollup of 9 pull requests Successful merges: - #140482 (std::net: update tcp deferaccept delay type to Duration.) - #146037 (Introduce CoerceShared lang item and trait, and basic Reborrow tests) - #146732 (tests: relax expectations after llvm change 902ddda120a5) - #147018 (re-order normalizations in run-make linker-warning test) - #147032 (Fix doctest compilation time display) - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`) - #147050 (PassWrapper: update for new PGOOptions args in LLVM 22) - #147075 (Make `def_path_hash_to_def_id` not panic when passed an invalid hash) - #147076 (update issue number for more_float_constants) r? `@ghost` `@rustbot` modify labels: rollup
@rustbot ready |
@bors r+ |
…n, r=joboet std::net: update tcp deferaccept delay type to Duration. See comment [here](rust-lang#119639 (comment)).
…n, r=joboet std::net: update tcp deferaccept delay type to Duration. See comment [here](rust-lang#119639 (comment)).
Rollup of 6 pull requests Successful merges: - #140482 (std::net: update tcp deferaccept delay type to Duration.) - #141469 (Allow `&raw [mut | const]` for union field in safe code) - #144197 (TypeTree support in autodiff) - #146675 (Allow shared access to `Exclusive<T>` when `T: Sync`) - #147113 (Reland "Add LSX accelerated implementation for source file analysis") - #147120 (Fix --extra-checks=spellcheck to prevent cargo install every time) r? `@ghost` `@rustbot` modify labels: rollup
See comment here.