copy FTP data to memory stream to avoid issues when client is closed before reading is complete, closes #1094

This commit is contained in:
Philipp Crocoll
2020-03-09 11:58:19 +01:00
parent e667f4e89c
commit b9a15471ef

View File

@@ -216,9 +216,12 @@ namespace keepass2android.Io
try
{
using (var cl = GetClient(ioc))
{
return cl.OpenRead(IocToLocalPath(ioc), FtpDataType.Binary, 0);
}
{
var memStream = new MemoryStream();
cl.OpenRead(IocToLocalPath(ioc), FtpDataType.Binary, 0).CopyTo(memStream);
memStream.Seek(0, SeekOrigin.Begin);
return memStream;
}
}
catch (FtpCommandException ex)
{