Redefining Parameters: [match] section

The rules are set in the [match] sections of the drweb-icapd.ini configuration file. In these rules, special if statements are used.

Syntax of an if statement:

if BOOL_EXPR {
 configuration section
}

where BOOL_EXPR is a logical expression and configuration section is a list of parameters to which new values (different from the global values, specified in the configuration file) are to be assigned.

Value for a parameter is defined as follows:

1.Dr.Web ICAPD checkes whether the requested resource matches any of the black list category.

2.If the corresponding URL is found in a black list (for example, in the Terrorism list), Dr.Web ICAPD requests value of the BlockNAME parameter, where NAME is a category of the black list (in the given example, BlockTerrorism).

3.The value is first searched in the [match] section according to the following algorithm:

for all request variables, value of the if-statement expression is calculated.

if true, the required parameter is searched in the configuration section.

if this parameter is found, its value is returned and the search completes

if this parameter is not found or if the if statement is false, Dr.Web ICAPD goes to the next if-statement.

4.If in the [match] section none of the rules is matching or does not contain the required parameter, the global parameter value is returned (or its default value, if this parameter is not specified in the configuration file).

Search of the parameter value is performed until the first match; thus, the first found value is returned (from the configuration blocks of those if statements that have true expressions).