mirror of
https://github.com/sochix/TLSharp.git
synced 2026-03-07 22:13:52 +01:00
If we've reconnected to another DC during GetFile, ensure we always reconnect to original DC even if there is an exception
This commit is contained in:
parent
133b9fdf6c
commit
4146459be2
|
|
@ -329,20 +329,24 @@ namespace TLSharp.Core
|
||||||
var serverPort = _session.Port;
|
var serverPort = _session.Port;
|
||||||
|
|
||||||
await ReconnectToDcAsync(ex.DC);
|
await ReconnectToDcAsync(ex.DC);
|
||||||
var auth = await SendRequestAsync<TLAuthorization>(new TLRequestImportAuthorization
|
try
|
||||||
{
|
{
|
||||||
bytes = exportedAuth.bytes,
|
var auth = await SendRequestAsync<TLAuthorization>(new TLRequestImportAuthorization
|
||||||
id = exportedAuth.id
|
{
|
||||||
});
|
bytes = exportedAuth.bytes,
|
||||||
result = await GetFile(location, filePartSize, offset);
|
id = exportedAuth.id
|
||||||
|
});
|
||||||
_session.AuthKey = authKey;
|
result = await GetFile(location, filePartSize, offset);
|
||||||
_session.TimeOffset = timeOffset;
|
}
|
||||||
_transport = new TcpTransport(serverAddress, serverPort);
|
finally
|
||||||
_session.ServerAddress = serverAddress;
|
{
|
||||||
_session.Port = serverPort;
|
_session.AuthKey = authKey;
|
||||||
await ConnectAsync();
|
_session.TimeOffset = timeOffset;
|
||||||
|
_transport = new TcpTransport(serverAddress, serverPort);
|
||||||
|
_session.ServerAddress = serverAddress;
|
||||||
|
_session.Port = serverPort;
|
||||||
|
await ConnectAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue