Skip to content

Commit

Permalink
Fix building with socks-proxy feature (fortanix#91)
Browse files Browse the repository at this point in the history
This PR corrects a variable name and type, and ensures we
test the socks-proxy feature as part of the test matrix.
  • Loading branch information
algesten authored Jun 24, 2020
1 parent 3cb178e commit 6bb838f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
feature:
- charset
- cookies
- socks-proxy
env:
RUST_BACKTRACE: "1"
steps:
Expand Down
5 changes: 3 additions & 2 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,9 @@ fn connect_socks5(
let (lock, cvar) = &*master_signal;
let done = lock.lock().unwrap();

let timeout_connect = time_until_deadline(deadline)?;
let done_result = cvar
.wait_timeout(done, time_until_deadline(deadline)?)
.wait_timeout(done, timeout_connect)
.unwrap();
let done = done_result.0;
if *done {
Expand All @@ -534,7 +535,7 @@ fn connect_socks5(
ErrorKind::TimedOut,
format!(
"SOCKS5 proxy: {}:{} timed out connecting after {}ms.",
host, port, timeout_connect
host, port, timeout_connect.as_millis()
),
));
}
Expand Down

0 comments on commit 6bb838f

Please sign in to comment.