mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Fix windows Socket::connect_timeout
overflow
Signed-off-by: Eval EXEC <execvy@gmail.com>
This commit is contained in:
parent
e1c29d137d
commit
22f62df337
@ -159,7 +159,7 @@ impl Socket {
|
||||
}
|
||||
|
||||
let mut timeout = c::timeval {
|
||||
tv_sec: timeout.as_secs() as c_long,
|
||||
tv_sec: cmp::min(timeout.as_secs(), c_long::MAX as u64) as c_long,
|
||||
tv_usec: (timeout.subsec_nanos() / 1000) as c_long,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user