]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp: add custom actions that can continue tcp-(request|response) processing
authorThierry FOURNIER <tfournier@haproxy.com>
Fri, 29 May 2015 15:29:14 +0000 (17:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 May 2015 15:49:48 +0000 (17:49 +0200)
Actually, the tcp-request and tcp-response custom ation are always final
actions. This patch create a new type of action that can permit to
continue the evaluation of tcp-request and tcp-response processing.

include/types/proto_tcp.h
src/proto_tcp.c

index ce21daefcbc1d13f74608fb59f8ac9d44bf5b3d1..f41933b5b09da30f5fd4a32c3bef016c733d5447 100644 (file)
@@ -40,6 +40,7 @@ enum {
        TCP_ACT_CLOSE, /* close at the sender's */
        TCP_ACT_CAPTURE, /* capture a fetched sample */
        TCP_ACT_CUSTOM, /* Use for custom registered keywords. */
+       TCP_ACT_CUSTOM_CONT, /* Use for custom registered keywords. */
 };
 
 struct capture_prm {
index 38883786cf507372b7a6ef61b769db9aa253c6f0..4a4a806d1598b9dc9ea038372767e74c6cdc2ae8 100644 (file)
@@ -1221,8 +1221,10 @@ resume_execution:
                                        goto missing_data;
                                }
 
-                               /* otherwise accept */
-                               break;
+                               /* accept */
+                               if (rule->action == TCP_ACT_CUSTOM)
+                                       break;
+                               /* otherwise continue */
                        }
                }
        }
@@ -1342,8 +1344,10 @@ resume_execution:
                                        return 0;
                                }
 
-                               /* otherwise accept */
-                               break;
+                               /* accept */
+                               if (rule->action == TCP_ACT_CUSTOM)
+                                       break;
+                               /* otherwise continue */
                        }
                }
        }