CLEANUP: http_ana: Remove unused TXN flags

TX_CLDENY, TX_CLALLOW, TX_SVDENY and TX_SVALLOW flags are unused. Only
TX_CLTARPIT is used to make the difference between an http deny rule and an http
tarpit rule. So these unused flags are removed.
This commit is contained in:
Christopher Faulet 2020-05-13 08:12:22 +02:00
parent 8177ad9895
commit a53abad42d
3 changed files with 3 additions and 15 deletions

View File

@ -323,10 +323,6 @@ void show_txn_flags(unsigned int f)
} }
SHOW_FLAG(f, TX_CLTARPIT); SHOW_FLAG(f, TX_CLTARPIT);
SHOW_FLAG(f, TX_SVALLOW);
SHOW_FLAG(f, TX_SVDENY);
SHOW_FLAG(f, TX_CLALLOW);
SHOW_FLAG(f, TX_CLDENY);
if (f) { if (f) {
printf("EXTRA(0x%08x)", f); printf("EXTRA(0x%08x)", f);

View File

@ -30,10 +30,7 @@
/* These are the flags that are found in txn->flags */ /* These are the flags that are found in txn->flags */
/* action flags */ /* action flags */
#define TX_CLDENY 0x00000001 /* a client header matches a deny regex */ /* Unusued: 0x00000001..0x00000008 */
#define TX_CLALLOW 0x00000002 /* a client header matches an allow regex */
#define TX_SVDENY 0x00000004 /* a server header matches a deny regex */
#define TX_SVALLOW 0x00000008 /* a server header matches an allow regex */
#define TX_CLTARPIT 0x00000010 /* the transaction is tarpitted (anti-dos) */ #define TX_CLTARPIT 0x00000010 /* the transaction is tarpitted (anti-dos) */
/* transaction flags dedicated to cookies : bits values 0x20 to 0x80 (0-7 shift 5) */ /* transaction flags dedicated to cookies : bits values 0x20 to 0x80 (0-7 shift 5) */

View File

@ -2886,7 +2886,6 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
rule_ret = HTTP_RULE_RES_DONE; rule_ret = HTTP_RULE_RES_DONE;
goto end; goto end;
case ACT_RET_DENY: case ACT_RET_DENY:
txn->flags |= TX_CLDENY;
if (txn->status == -1) if (txn->status == -1)
txn->status = 403; txn->status = 403;
rule_ret = HTTP_RULE_RES_DENY; rule_ret = HTTP_RULE_RES_DENY;
@ -2908,7 +2907,6 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
goto end; goto end;
case ACT_ACTION_DENY: case ACT_ACTION_DENY:
txn->flags |= TX_CLDENY;
txn->status = rule->arg.http_deny.status; txn->status = rule->arg.http_deny.status;
if (rule->arg.http_deny.errmsg) if (rule->arg.http_deny.errmsg)
txn->errmsg = rule->arg.http_deny.errmsg; txn->errmsg = rule->arg.http_deny.errmsg;
@ -2992,9 +2990,8 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
* is returned, the process can continue the evaluation of next rule list. If * is returned, the process can continue the evaluation of next rule list. If
* *STOP or *DONE is returned, the process must stop the evaluation. If *BADREQ * *STOP or *DONE is returned, the process must stop the evaluation. If *BADREQ
* is returned, it means the operation could not be processed and a server error * is returned, it means the operation could not be processed and a server error
* must be returned. It may set the TX_SVDENY on txn->flags if it encounters a * must be returned. If *YIELD is returned, the caller must call again the
* deny rule. If *YIELD is returned, the caller must call again the function * function with the same context.
* with the same context.
*/ */
static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct list *rules, static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct list *rules,
struct stream *s) struct stream *s)
@ -3067,7 +3064,6 @@ resume_execution:
rule_ret = HTTP_RULE_RES_DONE; rule_ret = HTTP_RULE_RES_DONE;
goto end; goto end;
case ACT_RET_DENY: case ACT_RET_DENY:
txn->flags |= TX_CLDENY;
if (txn->status == -1) if (txn->status == -1)
txn->status = 502; txn->status = 502;
rule_ret = HTTP_RULE_RES_DENY; rule_ret = HTTP_RULE_RES_DENY;
@ -3089,7 +3085,6 @@ resume_execution:
goto end; goto end;
case ACT_ACTION_DENY: case ACT_ACTION_DENY:
txn->flags |= TX_CLDENY;
txn->status = rule->arg.http_deny.status; txn->status = rule->arg.http_deny.status;
if (rule->arg.http_deny.errmsg) if (rule->arg.http_deny.errmsg)
txn->errmsg = rule->arg.http_deny.errmsg; txn->errmsg = rule->arg.http_deny.errmsg;