]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: filters: Add pre and post analyzer callbacks
authorChristopher Faulet <cfaulet@qualys.com>
Wed, 11 May 2016 15:13:39 +0000 (17:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 May 2016 13:11:54 +0000 (15:11 +0200)
commit3a394fa7cd6722ffa77eaea6748682992349e2b5
tree8c82d7a23cdbeaa95bdd1f14d86797fec7055d59
parenta9215b7206eed42cc777d319735967e9b09190af
MEDIUM: filters: Add pre and post analyzer callbacks

'channel_analyze' callback has been removed. Now, there are 2 callbacks to
surround calls to analyzers:

  * channel_pre_analyze: Called BEFORE all filterable analyzers. it can be
    called many times for the same analyzer, once at each loop until the
    analyzer finishes its processing. This callback is resumable, it returns a
    negative value if an error occurs, 0 if it needs to wait, any other value
    otherwise.

  * channel_post_analyze: Called AFTER all filterable analyzers. Here, AFTER
    means when an analyzer finishes its processing. This callback is NOT
    resumable, it returns a negative value if an error occurs, any other value
    otherwise.

Pre and post analyzer callbacks are not automatically called. 'pre_analyzers'
and 'post_analyzers' bit fields in the filter structure must be set to the right
value using AN_* flags (see include/types/channel.h).

The flag AN_RES_ALL has been added (AN_REQ_ALL already exists) to ease the life
of filter developers. AN_REQ_ALL and AN_RES_ALL include all filterable
analyzers.
include/proto/filters.h
include/types/channel.h
include/types/filters.h
src/filters.c
src/flt_trace.c
src/stream.c