Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
L
liberty-tunnel-client-library-apple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liberty
tunnel
liberty-tunnel-client-library-apple
Commits
9f54f2d6
Commit
9f54f2d6
authored
Nov 18, 2020
by
Jose Blaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle nil addresses
parent
340ea499
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
PIALibrary/Sources/Core/WebServices/Server.swift
PIALibrary/Sources/Core/WebServices/Server.swift
+6
-0
No files found.
PIALibrary/Sources/Core/WebServices/Server.swift
View file @
9f54f2d6
...
...
@@ -248,6 +248,9 @@ extension Server {
}
public
func
bestAddress
()
->
ServerAddressIP
?
{
guard
!
addresses
()
.
isEmpty
else
{
return
nil
}
let
availableServer
=
addresses
()
.
first
(
where
:
{
$0
.
available
})
if
availableServer
==
nil
{
addresses
()
.
map
({
$0
.
reset
()})
...
...
@@ -257,6 +260,9 @@ extension Server {
}
public
func
bestAddressForOVPN
(
tcp
:
Bool
)
->
ServerAddressIP
?
{
guard
!
ovpnAddresses
(
tcp
:
tcp
)
.
isEmpty
else
{
return
nil
}
let
availableServer
=
ovpnAddresses
(
tcp
:
tcp
)
.
first
(
where
:
{
$0
.
available
})
if
availableServer
==
nil
{
ovpnAddresses
(
tcp
:
tcp
)
.
map
({
$0
.
reset
()})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment