graingert / python-clamd

Clamd is a python interface to Clamd (Clamav daemon). By using Clamd, you can add virus detection capabilities to your python software in an efficient and easy way.
82 stars 39 forks source link

Issue with large file 520mb #31

Closed chandanadesilva closed 1 month ago

chandanadesilva commented 1 month ago

I am having an issue with a 520mb file. The error I am getting is:

File "/var/task/clamd/__init__.py", line 190, in instream
self.clamd_socket.send(size + chunk)
BrokenPipeError: [Errno 32] Broken pipe

I have looked at the code, line #185 to 195 in init.py, and can't see anything wrong. I am assuming that clamd is breaking the buffer into 1k (or is it 1mb) chunks and sending it through. The StreamMaxLength in etc/clamav/clamd.conf seems to be 25M :

# grep StreamMaxLength /etc/clamav/clamd.conf
#StreamMaxLength 25M

My Python is not very good. I hope someone can help!

chandanadesilva commented 1 month ago

Replying to my own issue. I set StreamMaxLength to 1024M and my file went through!