This commit is contained in:
MichaelManley 2017-11-08 15:19:56 +00:00 committed by GitHub
commit b740546bf5

View file

@ -305,20 +305,24 @@ namespace TLSharp.Core
var serverPort = _session.Port; var serverPort = _session.Port;
await ReconnectToDcAsync(ex.DC); await ReconnectToDcAsync(ex.DC);
try
{
var auth = await SendRequestAsync<TLAuthorization>(new TLRequestImportAuthorization var auth = await SendRequestAsync<TLAuthorization>(new TLRequestImportAuthorization
{ {
bytes = exportedAuth.bytes, bytes = exportedAuth.bytes,
id = exportedAuth.id id = exportedAuth.id
}); });
result = await GetFile(location, filePartSize, offset); result = await GetFile(location, filePartSize, offset);
}
finally
{
_session.AuthKey = authKey; _session.AuthKey = authKey;
_session.TimeOffset = timeOffset; _session.TimeOffset = timeOffset;
_transport = new TcpTransport(serverAddress, serverPort); _transport = new TcpTransport(serverAddress, serverPort);
_session.ServerAddress = serverAddress; _session.ServerAddress = serverAddress;
_session.Port = serverPort; _session.Port = serverPort;
await ConnectAsync(); await ConnectAsync();
}
} }
return result; return result;