Browse code

bb12227: Patch to adjust the default CommandReadTimeout to reduce the chance of mail loss when using clamav-milter with the TCP socket. Contribution by Scott Kitterman.

Micah Snyder authored on 2018/12/08 06:57:20
Showing 4 changed files
... ...
@@ -15,6 +15,15 @@ To address this issue, the internal `cltypes.h` header has been replaced by
15 15
 a `clamav-types.h` that is generated on `./configure` and will be installed
16 16
 alongside `clamav.h`.
17 17
 
18
+Additional Changes:
19
+- Increased the default CommandReadTimeout to reduce the chance of mail loss
20
+  if using clamav-milter with the TCP socket. Contribution by Scott Kitterman.
21
+
22
+### Acknowledgements
23
+
24
+The ClamAV team thanks the following individuals for their code submissions:
25
+- Scott Kitterman
26
+
18 27
 ## 0.101.0
19 28
 
20 29
 ClamAV 0.101.0 is a feature release with an assortment of improvements that
... ...
@@ -171,11 +171,13 @@ Default: 120
171 171
 .TP
172 172
 \fBCommandReadTimeout NUMBER\fR
173 173
 This option specifies the time (in seconds) after which clamd should
174
-timeout if a client doesn't provide any initial command after connecting.
174
+timeout if a client doesn't provide any initial command after connecting.  The
175
+default is set to 30 to avoid timeouts with TCP sockets when processing large
176
+messages.  If using a Unix socket, the value can be changed to 5.
175 177
 Note: the timeout for subsequents commands, and/or data chunks is specified by
176 178
 ReadTimeout.
177 179
 .br
178
-Default: 5
180
+Default: 30
179 181
 .TP
180 182
 \fBSendBufTimeout NUMBER\fR
181 183
 This option specifies how long to wait (in milliseconds) if the send buffer is full.
... ...
@@ -145,8 +145,8 @@ Example
145 145
 
146 146
 # This option specifies the time (in seconds) after which clamd should
147 147
 # timeout if a client doesn't provide any initial command after connecting.
148
-# Default: 5
149
-#CommandReadTimeout 5
148
+# Default: 30
149
+#CommandReadTimeout 30
150 150
 
151 151
 # This option specifies how long to wait (in milliseconds) if the send buffer
152 152
 # is full.
... ...
@@ -247,7 +247,7 @@ const struct clam_option __clam_options[] = {
247 247
 
248 248
     { "ReadTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 120, NULL, 0, OPT_CLAMD, "This option specifies the time (in seconds) after which clamd should\ntimeout if a client doesn't provide any data.", "120" },
249 249
 
250
-    { "CommandReadTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 5, NULL, 0, OPT_CLAMD, "This option specifies the time (in seconds) after which clamd should\ntimeout if a client doesn't provide any initial command after connecting.", "5" },
250
+    { "CommandReadTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 30, NULL, 0, OPT_CLAMD, "This option specifies the time (in seconds) after which clamd should\ntimeout if a client doesn't provide any initial command after connecting.", "30" },
251 251
 
252 252
     { "SendBufTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 500, NULL, 0, OPT_CLAMD, "This option specifies how long to wait (in milliseconds) if the send buffer\nis full. Keep this value low to prevent clamd hanging.", "200"},
253 253