copy FTP data to memory stream to avoid issues when client is closed before reading is complete, closes #1094
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user