Actions may yield but must not do it during the final call from a ruleset
because it indicates there will be no more opportunity to complete or
clean up. This is indicated by ACT_FLAG_FINAL in the action's flags,
which must be passed to hlua_resume().
Thanks to this, an action called from a TCP ruleset is properly woken
up and possibly finished when the client disconnects.
}
/* Execute the function. */
- switch (hlua_ctx_resume(&s->hlua, 1)) {
+ switch (hlua_ctx_resume(&s->hlua, !(flags & ACT_FLAG_FINAL))) {
/* finished. */
case HLUA_E_OK:
if (!hlua_check_proto(s, dir))