mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 22:45:38 +00:00
Maintain AddressFamily when migrating DCs
This commit is contained in:
parent
f711948da7
commit
f6e14c7499
2 changed files with 5 additions and 1 deletions
|
|
@ -354,7 +354,9 @@ namespace WTelegram
|
|||
{
|
||||
_dcSession.DataCenter = _session.DcOptions.Where(dc => dc.id == TLConfig.this_dc)
|
||||
.OrderByDescending(dc => dc.ip_address == endpoint?.Address.ToString())
|
||||
.ThenByDescending(dc => dc.port == endpoint?.Port).First();
|
||||
.ThenByDescending(dc => dc.port == endpoint?.Port)
|
||||
.ThenByDescending(dc => dc.flags == (endpoint?.AddressFamily == AddressFamily.InterNetworkV6 ? DcOption.Flags.ipv6 : 0))
|
||||
.First();
|
||||
_session.DCSessions[TLConfig.this_dc] = _dcSession;
|
||||
}
|
||||
if (_session.MainDC == 0) _session.MainDC = TLConfig.this_dc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue