mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-30 09:21:28 +00:00
Merge branch 'master' of https://github.com/peter-iakovlev/TelegramCore
This commit is contained in:
commit
47df0e451a
@ -22,7 +22,9 @@ func managedConfigurationUpdates(postbox: Postbox, network: Network) -> Signal<V
|
||||
if addressList[Int(id)] == nil {
|
||||
addressList[Int(id)] = []
|
||||
}
|
||||
addressList[Int(id)]!.append(MTDatacenterAddress(ip: ipAddress, port: UInt16(port), preferForMedia: preferForMedia, restrictToTcp: false))
|
||||
let restrictToTcp = (flags & (1 << 2)) != 0
|
||||
let isCdn = (flags & (1 << 3)) != 0
|
||||
addressList[Int(id)]!.append(MTDatacenterAddress(ip: ipAddress, port: UInt16(port), preferForMedia: preferForMedia, restrictToTcp: restrictToTcp, cdn: isCdn))
|
||||
}
|
||||
}
|
||||
network.context.performBatchUpdates {
|
||||
|
@ -326,7 +326,7 @@ func initializedNetwork(apiId: Int32, supplementary: Bool, datacenterId: Int, ke
|
||||
}
|
||||
|
||||
for (id, ip) in seedAddressList {
|
||||
context.setSeedAddressSetForDatacenterWithId(id, seedAddressSet: MTDatacenterAddressSet(addressList: [MTDatacenterAddress(ip: ip, port: 443, preferForMedia: false, restrictToTcp: false)]))
|
||||
context.setSeedAddressSetForDatacenterWithId(id, seedAddressSet: MTDatacenterAddressSet(addressList: [MTDatacenterAddress(ip: ip, port: 443, preferForMedia: false, restrictToTcp: false, cdn: false)]))
|
||||
}
|
||||
|
||||
context.keychain = keychain
|
||||
|
@ -63,7 +63,9 @@ public class Serialization: NSObject, MTSerialization {
|
||||
switch option {
|
||||
case let .dcOption(flags, id, ipAddress, port) where id == datacenterId:
|
||||
let preferForMedia = (flags & (1 << 1)) != 0
|
||||
addressList.append(MTDatacenterAddress(ip: ipAddress, port: UInt16(port), preferForMedia: preferForMedia, restrictToTcp: false))
|
||||
let restrictToTcp = (flags & (1 << 2)) != 0
|
||||
let isCdn = (flags & (1 << 3)) != 0
|
||||
addressList.append(MTDatacenterAddress(ip: ipAddress, port: UInt16(port), preferForMedia: preferForMedia, restrictToTcp: restrictToTcp, cdn: isCdn))
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user