transport: rename "ExtraneousData" to "UnexpectedData"

This commit is contained in:
Nick Mathewson 2022-10-19 12:05:37 -04:00
parent f39157f8c3
commit 27f53f241d
1 changed files with 5 additions and 5 deletions

View File

@ -145,7 +145,7 @@ pub(crate) async fn connect_via_proxy<R: TcpProvider + Send + Sync>(
}
if n_read != 0 {
return Err(ProxyError::ExtraneousData);
return Err(ProxyError::UnexpectedData);
}
Ok(stream)
@ -189,8 +189,8 @@ pub enum ProxyError {
/// prevent bugs.
///
/// We could someday remove this limitation.
#[error("Received extraneous data from peer")]
ExtraneousData,
#[error("Received unexpected early data from peer")]
UnexpectedData,
/// The proxy told us that our attempt failed.
#[error("SOCKS proxy reported an error: {0}")]
@ -213,7 +213,7 @@ impl tor_error::HasKind for ProxyError {
E::UnrecognizedAddr => EK::NotImplemented,
E::SocksProto(_) => EK::LocalProtocolViolation,
E::Bug(e) => e.kind(),
E::ExtraneousData => EK::NotImplemented,
E::UnexpectedData => EK::NotImplemented,
E::SocksError(_) => EK::LocalProtocolFailed,
}
}
@ -231,7 +231,7 @@ impl tor_error::HasRetryTime for ProxyError {
E::InvalidSocksRequest(_) => RT::Never,
E::SocksProto(_) => RT::AfterWaiting,
E::Bug(_) => RT::Never,
E::ExtraneousData => RT::Never,
E::UnexpectedData => RT::Never,
E::SocksError(e) => match *e {
S::CONNECTION_REFUSED
| S::GENERAL_FAILURE