Improve logging of ConnectionStrategy
This commit is contained in:
parent
bb40404a51
commit
1ff936895f
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 2.2.7 (2020-06-11)
|
||||
|
||||
- Code cleanup.
|
||||
|
||||
## 2.2.6 (2020-05-12)
|
||||
|
||||
- Address concerns from Guido Vranken fuzzers. [#141](https://github.com/passepartoutvpn/tunnelkit/pull/141)
|
||||
|
@ -84,17 +84,20 @@ class ConnectionStrategy {
|
||||
currentEndpointIndex = 0
|
||||
if let resolvedAddresses = configuration.resolvedAddresses {
|
||||
if configuration.prefersResolvedAddresses {
|
||||
log.debug("Will use pre-resolved addresses only")
|
||||
endpoints = ConnectionStrategy.unrolledEndpoints(
|
||||
records: resolvedAddresses.map { DNSRecord(address: $0, isIPv6: false) },
|
||||
protos: endpointProtocols
|
||||
)
|
||||
} else {
|
||||
log.debug("Will use DNS resolution with fallback to pre-resolved addresses")
|
||||
endpoints = []
|
||||
}
|
||||
self.resolvedAddresses = resolvedAddresses
|
||||
} else {
|
||||
log.debug("Will use DNS resolution")
|
||||
guard hostname != nil else {
|
||||
fatalError("Either configuration.hostname or resolvedRecords required")
|
||||
fatalError("Either configuration.sessionConfiguration.hostname or configuration.resolvedAddresses required")
|
||||
}
|
||||
endpoints = []
|
||||
resolvedAddresses = []
|
||||
|
Loading…
Reference in New Issue
Block a user