Added progress messages to clamd core.

This commit is contained in:
2017-05-19 01:27:05 +01:00
parent 6ff82e7b56
commit 9e136bb7c3
6 changed files with 35 additions and 3 deletions

View File

@@ -144,10 +144,16 @@ namespace osrepodbmgr.Core
inFs.Seek(8, SeekOrigin.Current);
zStream = new LzmaStream(properties, inFs);
if(UpdateProgress != null)
UpdateProgress("Uncompressing file...", null, 0, 0);
zStream.CopyTo(outFs);
zStream.Close();
outFs.Close();
if(UpdateProgress != null)
UpdateProgress("Requesting local scan to clamd server...", null, 0, 0);
Task.Run(async () =>
{
result = await clam.ScanFileOnServerMultithreadedAsync(tmpFile);
@@ -156,10 +162,15 @@ namespace osrepodbmgr.Core
File.Delete(tmpFile);
}
else
{
if(UpdateProgress != null)
UpdateProgress("Requesting local scan to clamd server...", null, 0, 0);
Task.Run(async () =>
{
result = await clam.ScanFileOnServerMultithreadedAsync(repoPath);
}).Wait();
}
}
else
{
@@ -181,6 +192,9 @@ namespace osrepodbmgr.Core
break;
}
if(UpdateProgress != null)
UpdateProgress("Uploading file to clamd server...", null, 0, 0);
Task.Run(async () =>
{
result = await clam.SendAndScanFileAsync(zStream);