MINOR: filters/lua: Support the HTTP filtering from filters written in lua
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 26 Feb 2020 16:15:48 +0000 (17:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Aug 2021 06:57:07 +0000 (08:57 +0200)
commiteae8afaa6067983ac1e9fe108d6cd920dcfab947
tree7045de4d97a52268e22e0b670d6fe7abee14e9b2
parent78c35471f8f531dd31d3b2b845d59697f195a160
MINOR: filters/lua: Support the HTTP filtering from filters written in lua

Now an HTTPMessage class is available to manipulate HTTP message from a filter
it is possible to bind HTTP filters callback function on lua functions. Thus,
following methods may now be defined by a lua filter:

  * Filter:http_headers(txn, http_msg)
  * Filter:http_payload(txn, http_msg, offset, len)
  * Filter:http_end(txn, http_msg)

http_headers() and http_end() may return one of the constant filter.CONTINUE,
filter.WAIT or filter.ERROR. If nothing is returned, filter.CONTINUE is used as
the default value. On its side, http_payload() may return the amount of data to
forward. If nothing is returned, all incoming data are forwarded.

For now, these functions are not allowed to yield because this interferes with
the filter workflow.
src/hlua.c