Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ENGINE_OPTIONS_FORCE_TO_DISK scan performance
There is a scan logic issue where the main libclamav scanning functions create an extra "nested" fmap for each file being scanned. This is slightly inefficient for a normal scan, but causes a major performance issue when using ENGINE_OPTIONS_FORCE_TO_DISK. It causes every scanned file to be duplicated in the temp directory before the scan. We fix this by using `cli_magic_scan()` in `scan_common()` instead of `cli_magic_scan_nested_fmap_type()`. We can do this now that the `cl_scandesc_callback()` API creates an fmap for the caller, instead of the old logic where `scan_common()` called different API's depending on whether or not we have an fmap or a file descriptor.
- Loading branch information