BUG/MEDIUM: filters: Exec pre/post analysers only one time per filter

For each filter, pre and post callback functions must only be called one
time. To do so, when one of them is finished, the corresponding analyser bit
must be removed from pre_analyzers or post_analyzers bit field. It is only
an issue with pre-analyser callback functions if the corresponding analyser
yields. It may happens with lua action for instance. In this case, the
filters pre analyser callback function is unexpectedly called several times.

This patch should fix the issue #1263. It must be backported is all stable
versions.

(cherry picked from commit a6d3704e38b6c1cb09286e9778b6363825d65c4d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 476013c1213bd053c4c29984fc07c980e71893a2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 088f378c436cd0075f04a7304b4c921fbcd3ea22)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c39857c384d7e4bc9a0e1e2201103ed8e4f226c3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/filters.c b/src/filters.c
index a4ff257..f57cc8f 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -923,6 +923,7 @@
 			ret = FLT_OPS(filter)->channel_pre_analyze(s, filter, chn, an_bit);
 			if (ret <= 0)
 				BREAK_EXECUTION(s, chn, check_result);
+			filter->pre_analyzers &= ~an_bit;
 		}
 	} RESUME_FILTER_END;
 
@@ -950,6 +951,7 @@
 			ret = FLT_OPS(filter)->channel_post_analyze(s, filter, chn, an_bit);
 			if (ret < 0)
 				break;
+			filter->post_analyzers &= ~an_bit;
 		}
 	}
 	return handle_analyzer_result(s, chn, 0, ret);