MEDIUM: lua: Process buffer data using an offset and a length
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Aug 2021 11:49:54 +0000 (13:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Aug 2021 06:57:07 +0000 (08:57 +0200)
commit9a6ffda7958734f7ae2e2996953151e43b3e1df3
tree004932f44ec7b3302e5d07f843ef55284b2d0bbf
parentba9e21dc68044e2ce5ffce317e8786f1079f6fee
MEDIUM: lua: Process buffer data using an offset and a length

The main change is that following functions will now process channel's data
using an offset and a length:

  * hlua_channel_dup_yield()
  * hlua_channel_get_yield()
  * hlua_channel_getline_yield()
  * hlua_channel_append_yield()
  * hlua_channel_set()
  * hlua_channel_send_yield()
  * hlua_channel_forward_yield()

So for now, the offset is always the input data position and the length is
the input data length. But with the support for filters, from a filter
context, these values will be relative to the filter.

To make all processing clearer, the function _hlua_channel_dup() has been
updated and _hlua_channel_dupline(), _hlua_channel_insert() and
_hlua_channel_delete() have been added.

This patch is mandatory to allow the support of the filters written in lua.
src/hlua.c