tor-config Listen: Rename localhost_port_legacy (from _deprecated)
As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/602#note_2830847
This commit is contained in:
parent
a6d7e38f6d
commit
76066dac81
|
@ -509,7 +509,7 @@ where
|
|||
if let Some(proxy_matches) = matches.subcommand_matches("proxy") {
|
||||
let socks_port = match (
|
||||
proxy_matches.value_of("socks-port"),
|
||||
config.proxy().socks_listen.localhost_port_deprecated()?,
|
||||
config.proxy().socks_listen.localhost_port_legacy()?,
|
||||
) {
|
||||
(Some(p), _) => p.parse().expect("Invalid port specified"),
|
||||
(None, Some(s)) => s,
|
||||
|
@ -518,7 +518,7 @@ where
|
|||
|
||||
let dns_port = match (
|
||||
proxy_matches.value_of("dns-port"),
|
||||
config.proxy().dns_listen.localhost_port_deprecated()?,
|
||||
config.proxy().dns_listen.localhost_port_legacy()?,
|
||||
) {
|
||||
(Some(p), _) => p.parse().expect("Invalid port specified"),
|
||||
(None, Some(s)) => s,
|
||||
|
|
|
@ -147,7 +147,7 @@ impl Listen {
|
|||
///
|
||||
/// Fails, giving an unsupported error, if the configuration
|
||||
/// isn't just "listen on a single localhost port".
|
||||
pub fn localhost_port_deprecated(&self) -> Result<Option<u16>, ListenUnsupported> {
|
||||
pub fn localhost_port_legacy(&self) -> Result<Option<u16>, ListenUnsupported> {
|
||||
use ListenItem as LI;
|
||||
Ok(match &*self.0 {
|
||||
[] => None,
|
||||
|
@ -378,7 +378,7 @@ mod test {
|
|||
.map_err(|_| ()),
|
||||
exp_addrs
|
||||
);
|
||||
assert_eq!(ll.localhost_port_deprecated().map_err(|_| ()), exp_lpd);
|
||||
assert_eq!(ll.localhost_port_legacy().map_err(|_| ()), exp_lpd);
|
||||
}
|
||||
|
||||
let chk_err = |exp, s: &str| {
|
||||
|
|
Loading…
Reference in New Issue