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

Fix overflow in duration #1657

Merged
merged 4 commits into from
Feb 20, 2023
Merged

Fix overflow in duration #1657

merged 4 commits into from
Feb 20, 2023

Conversation

TethysSvensson
Copy link
Contributor

When trying to wait for Duration::MAX, mio will panic with an overflow. This is a work-around for that behavior.

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also fix it for Windows:

let dur_ms = (dur + Duration::from_nanos(999_999)).as_millis();
?

@TethysSvensson
Copy link
Contributor Author

Could you also fix it for Windows:

let dur_ms = (dur + Duration::from_nanos(999_999)).as_millis();

?

Done

@TethysSvensson
Copy link
Contributor Author

@Thomasdezeeuw I've updated the PR to fix some issues encountered by the CI.

@Thomasdezeeuw Thomasdezeeuw merged commit c45510f into tokio-rs:master Feb 20, 2023
@Thomasdezeeuw
Copy link
Collaborator

Thanks @TethysSvensson

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