Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ypoluektovich committed Jan 22, 2023
1 parent 70b7deb commit 7d9443b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/v5/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ impl SocksV5RequestStatus {
pub fn from_io_error(e: std::io::Error) -> SocksV5RequestStatus {
match e.raw_os_error() {
// ENETUNREACH
Some(101) => socksv5::v5::SocksV5RequestStatus::NetworkUnreachable,
Some(101) => SocksV5RequestStatus::NetworkUnreachable,
// ETIMEDOUT
Some(110) => socksv5::v5::SocksV5RequestStatus::TtlExpired,
Some(110) => SocksV5RequestStatus::TtlExpired,
// ECONNREFUSED
Some(111) => socksv5::v5::SocksV5RequestStatus::ConnectionRefused,
Some(111) => SocksV5RequestStatus::ConnectionRefused,
// EHOSTUNREACH
Some(113) => socksv5::v5::SocksV5RequestStatus::HostUnreachable,
Some(113) => SocksV5RequestStatus::HostUnreachable,
// Unhandled error code
_ => socksv5::v5::SocksV5RequestStatus::ServerFailure,
_ => SocksV5RequestStatus::ServerFailure,
}
}

#[cfg(not(unix))]
pub fn from_io_error(e: std::io::Error) -> SocksV5RequestStatus {
socksv5::v5::SocksV5RequestStatus::ServerFailure
SocksV5RequestStatus::ServerFailure
}
}

0 comments on commit 7d9443b

Please sign in to comment.