mirror of
https://github.com/claunia/apprepodbmgr.git
synced 2025-12-16 19:24:42 +00:00
Added progress messages to clamd core.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user