From da4f41291e3ee12d5a84e138a5c06561d9ffba97 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 2 Feb 2023 22:12:45 -0600 Subject: [PATCH] Fix handling of older IPv6 addresses --- Limelight/Database/TemporaryHost.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Limelight/Database/TemporaryHost.m b/Limelight/Database/TemporaryHost.m index 97824ac..c71d7ab 100644 --- a/Limelight/Database/TemporaryHost.m +++ b/Limelight/Database/TemporaryHost.m @@ -34,6 +34,11 @@ self.serverCodecModeSupport = host.serverCodecModeSupport; self.serverCert = host.serverCert; + // Older clients stored a non-URL-escaped IPv6 string. Try to detect that and fix it up. + if (![self.ipv6Address containsString:@"["]) { + self.ipv6Address = [Utils addressAndPortToAddressPortString:self.ipv6Address port:47989]; + } + // Ensure we don't use a stale cached pair state if we haven't pinned the cert yet self.pairState = host.serverCert ? [host.pairState intValue] : PairStateUnpaired;