From 6d2119f32e44fb9bdf0d294e1970a77cbf6ecb5b Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 12 Dec 2023 16:45:57 -0500 Subject: [PATCH] fix #347 and #349 --- veilid-server/src/settings.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/veilid-server/src/settings.rs b/veilid-server/src/settings.rs index 03fc4423..575a9c9f 100644 --- a/veilid-server/src/settings.rs +++ b/veilid-server/src/settings.rs @@ -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 { // 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) } }