diff --git a/ChangeLog b/ChangeLog index 98574510a..a45c1a37b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 21 18:19:18 CET 2011 (tk) +--------------------------------- + * clamd: update description of ReadTimeout (bb#2565) + Thu Feb 17 19:13:15 CET 2011 (tk) --------------------------------- * clamd: add new config option BytecodeUnsigned (bb#2537); drop diff --git a/clamd/scanner.c b/clamd/scanner.c index 2a084b10f..3a26be636 100644 --- a/clamd/scanner.c +++ b/clamd/scanner.c @@ -403,12 +403,7 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *en port += min_port; timeout = optget(opts, "ReadTimeout")->numarg; - if(timeout == 0) - timeout = -1; - firsttimeout = optget(opts, "CommandReadTimeout")->numarg; - if (firsttimeout == 0) - firsttimeout = -1; if(!bound && !portscan) { logg("!ScanStream: Can't find any free port.\n"); diff --git a/docs/man/clamd.8.in b/docs/man/clamd.8.in index c0f8a7f1c..9d1f76143 100644 --- a/docs/man/clamd.8.in +++ b/docs/man/clamd.8.in @@ -66,7 +66,7 @@ Clamd will process the commands asynchronously, and reply as soon as it has fini Clamd requires clients to read all the replies it sent, before sending more commands to prevent send() deadlocks. The recommended way to implement a client that uses IDSESSION is with non-blocking sockets, and a select()/poll() loop: whenever send would block, sleep in select/poll until either you can write more data, or read more replies. \fINote that using non-blocking sockets without the select/poll loop and alternating recv()/send() doesn't comply with clamd's requirements.\fR -If clamd detects that a client has deadlocked, it will close the connection. Note that clamd may close an IDSESSION connection too if you don't follow the protocol's requirements. +If clamd detects that a client has deadlocked, it will close the connection. Note that clamd may close an IDSESSION connection too if you don't follow the protocol's requirements. The client can use the PING command to keep the connection alive. .TP \fBVERSIONCOMMANDS\fR It is mandatory to prefix this command with either \fBn\fR or \fBz\fR. diff --git a/etc/clamd.conf b/etc/clamd.conf index 67ebee1dd..0cf929ecd 100644 --- a/etc/clamd.conf +++ b/etc/clamd.conf @@ -126,7 +126,6 @@ Example #MaxThreads 20 # Waiting for data from a client socket will timeout after this time (seconds). -# Value of 0 disables the timeout. # Default: 120 #ReadTimeout 300 diff --git a/shared/optparser.c b/shared/optparser.c index 3297530ee..4f83ffa32 100644 --- a/shared/optparser.c +++ b/shared/optparser.c @@ -220,7 +220,7 @@ const struct clam_option __clam_options[] = { { "SendBufTimeout", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 500, NULL, 0, OPT_CLAMD, "This option specifies how long to wait (in miliseconds) if the send buffer is full. Keep this value low to prevent clamd hanging\n", "200"}, - { "ReadTimeout", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 120, NULL, 0, OPT_MILTER, "Waiting for data from clamd will timeout after this time (seconds).\nValue of 0 disables the timeout.", "300" }, + { "ReadTimeout", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 120, NULL, 0, OPT_MILTER, "Waiting for data from clamd will timeout after this time (seconds).", "300" }, { "MaxQueue", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 100, NULL, 0, OPT_CLAMD, "Maximum number of queued items (including those being processed by MaxThreads threads)\nIt is recommended to have this value at least twice MaxThreads if possible.\nWARNING: you shouldn't increase this too much to avoid running out of file descriptors,\n the following condition should hold:\n MaxThreads*MaxRecursion + MaxQueue - MaxThreads + 6 < RLIMIT_NOFILE (usual max is 1024)\n", "200" },