add basic plugin

This commit is contained in:
2023-10-25 17:51:48 +02:00
parent 12df9de1b4
commit 55ed8ffbf9
5 changed files with 97 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
#include "./clamav_module_async_wrapper.hpp"
#include <cstdlib>
ClamAVModuleAsyncWrapper::ClamAVModuleAsyncWrapper(ClamAVModuleInterface& cavmi) : _cavmi(cavmi) {
}
@@ -7,6 +9,7 @@ std::future<ClamAVModuleAsyncWrapper::ScanResult> ClamAVModuleAsyncWrapper::scan
return std::async(
std::launch::async,
[this](std::string inner_path) {
std::srand(5693);
// TODO: optimize, clamav supports multi threading
std::lock_guard lock_guard{_cavmi_mutex};
return _cavmi.scanFilePath(inner_path);