mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-24 23:09:25 -05:00
parent
7129343ea1
commit
6d2119f32e
@ -384,7 +384,7 @@ impl serde::Serialize for NamedSocketAddrs {
|
||||
}
|
||||
|
||||
impl NamedSocketAddrs {
|
||||
pub fn offset_port(&mut self, offset: u16) -> EyreResult<()> {
|
||||
pub fn offset_port(&mut self, offset: u16) -> EyreResult<bool> {
|
||||
// Bump port on name
|
||||
if let Some(split) = self.name.rfind(':') {
|
||||
let hoststr = &self.name[0..split];
|
||||
@ -393,7 +393,7 @@ impl NamedSocketAddrs {
|
||||
|
||||
self.name = format!("{}:{}", hoststr, port);
|
||||
} else {
|
||||
bail!("no port specified to offset");
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
// Bump port on addresses
|
||||
@ -401,7 +401,7 @@ impl NamedSocketAddrs {
|
||||
addr.set_port(addr.port() + offset);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user