-
Improvement
-
Resolution: Fixed
-
Minor
-
3.9
-
MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
Back in MDL-50907, kabalin proposed a 1kb chunksize in lib/antivirus/clamav/scanner.php:
/** Default socket data stream chunk size */
|
define('ANTIVIRUS_CLAMAV_SOCKET_CHUNKSIZE', 1024);
|
It turns out that for any reasonably large files, this will result in so many steps (1 million writes to the ClamAV socket for a 1Gb file) that the socket would die with a "fwrite(): send of \d bytes failed with errno=32 Broken pipe" error.
For a somewhat reasonable memory consumption, I propose to raise this to 32Mb, statically.
(Of course, it would be possible to make it configurable, but it's a lot more work. )