There are two parameters that affect the session timeout: the SessionTimeout
parameter of the HTTP mode configuration file and the X-KAV-Timeout
request header. This section explains how to configure the session timeout for Kaspersky Scan Engine in HTTP mode by using these two values.
SessionTimeout
This parameter of the configuration file sets the maximum time that Kaspersky Scan Engine can spend on receiving a scan request for an object and on processing this request (scanning operation), in milliseconds. This timeout is valid for all objects sent to Kaspersky Scan Engine.
Consider the following example: the value of SessionTimeout
is set to 4000
(four seconds), and the request does not contain the X-KAV-Timeout
header. Kaspersky Scan Engine spends one second on receiving the request. Then Kaspersky Scan Engine spends the remaining three seconds on scanning.
X-KAV-Timeout
This header sets the time that Kaspersky Scan Engine can spend on a scanning operation (in milliseconds), regardless of the value of the SessionTimeout
parameter.
The range of values for this parameter is from 0
to 4294967295
(an unsigned 32-bit integer).
Consider the following example: the value of SessionTimeout
is set to 4000
(four seconds), and the value of X-KAV-Timeout
is set to 10000
(10 seconds). Kaspersky Scan Engine spends one second on receiving the request. Then Kaspersky Scan Engine spends 10 seconds (which is the value of X-KAV-Timeout
) on scanning.
If SessionTimeout
is exceeded during the reception of the request, the session is closed, regardless of the value of X-KAV-Timeout
.
Consider the following example: the value of SessionTimeout
is set to 4000
(four seconds), and the value of X-KAV-Timeout
is set to 10000
(10 seconds). Kaspersky Scan Engine spends four seconds on receiving the request, and the session is closed because SessionTimeout
is exceeded.
You can choose the value of X-KAV-Timeout
on the basis of the size of the files that you want to scan. For example, Kaspersky Scan Engine could require 10 seconds to scan a large file, or 0.1 seconds to scan a small one.