Freshclam Timeout Patch

Intro

I used to see freshclam instances sleeping forever on both connect() and recv()/read() calls. To circumvent such hurdles, this patch causes freshclam to protect those calls with explicit configurable timeouts.

The patch has been tested under Solaris 10 on Sparc and Linux 2.4.27 on i686. It has been reported to work in Darwin (OS X 10.4.7) as well.

How to Apply

Note: Please use GNU patch to apply the patch.

Applying against Clamav 0.88.x:

gunzip -c clamav-0.88.x.tar.gz | tar xf -

gunzip -c path/to/patchfile.gz | patch -p0 

cd clamav-0.88.x
aclocal
automake
configure
make
make install

Applying against Clamav CVS:

export CVS_RSH=ssh
cvs -d:ext:anoncvs@cvs.clamav.net:/cvsroot/clamav co clamav-devel

gunzip -c path/to/patchfile.gz | patch -p0 

cd clamav-devel
aclocal
automake
configure
make
make install

freshclam.conf

The patch adds the following options to freshclam.conf:

# Timeout in seconds when connecting to database server.
# Default: 10
#ConnectTimeout 30

# Timeout in seconds when reading from database server.
# Default: 10
#RecvTimeout 30

Latest patch against Clamav 0.88.4:

freshclam_0.88.4_timeout-3.patch.gz

Latest patch against Clamav 0.88.3:

freshclam_0.88.3_timeout-3.patch.gz

Latest patch against Clamav CVS as of 2006-08-04:

freshclam_cvs20060804_timeout-3.patch.gz

Feedback

You may contact me at: everton.marques@gmail.com