no | no | yes | yes
Arguments :
<action> defines the action to perform if the condition applies. Valid
- actions include : "accept", "reject".
- See "tcp-request connection" above for their signification.
+ actions include : "accept", "close", "reject".
<condition> is a standard layer 4-7 ACL-based condition (see section 7).
Response contents can be analysed at an early stage of response processing
called "TCP content inspection". During this stage, ACL-based rules are
evaluated every time the response contents are updated, until either an
- "accept" or a "reject" rule matches, or a TCP response inspection delay is
- set and expires with no matching rule.
+ "accept", "close" or a "reject" rule matches, or a TCP response inspection
+ delay is set and expires with no matching rule.
Most often, these decisions will consider a protocol recognition or validity.
or false (when used with "unless"). The first such rule executed ends
the rules evaluation.
+ - close :
+ immediately closes the connection with the server if the condition is
+ true (when used with "if"), or false (when used with "unless"). The
+ first such rule executed ends the rules evaluation. The main purpose of
+ this action is to force a connection to be finished between a client
+ and a server after an exchange when the application protocol expects
+ some long time outs to elapse first. The goal is to eliminate idle
+ connections which take signifiant resources on servers with certain
+ protocols.
+
- reject :
rejects the response if the condition is true (when used with "if")
or false (when used with "unless"). The first such rule executed ends
#include <proto/sample.h>
#include <proto/session.h>
#include <proto/stick_table.h>
+#include <proto/stream_interface.h>
#include <proto/task.h>
#ifdef CONFIG_HAP_CTTPROXY
s->flags |= SN_FINST_D;
return 0;
}
+ else if (rule->action == TCP_ACT_CLOSE) {
+ rep->prod->flags |= SI_FL_NOLINGER | SI_FL_NOHALF;
+ si_shutr(rep->prod);
+ si_shutw(rep->prod);
+ break;
+ }
else {
/* otherwise accept */
break;
arg++;
rule->action = TCP_ACT_REJECT;
}
+ else if (strcmp(args[arg], "close") == 0) {
+ arg++;
+ rule->action = TCP_ACT_CLOSE;
+ }
else {
memprintf(err,
- "'%s %s' expects 'accept' or 'reject' in %s '%s' (got '%s')",
+ "'%s %s' expects 'accept', 'close' or 'reject' in %s '%s' (got '%s')",
args[0], args[1], proxy_type_str(curpx), curpx->id, args[arg]);
return -1;
}