Revert "BUG/MEDIUM: lua: can't handle the response bytes"
This reverts commit cd9084f77683106ace2fb863080e7d10e71c39fc.
This commit introduced a regression making it impossible to leave
process_session() during a forced yield because the analyser was always
set on the response even if not needed. The result was a busy loop
making haproxy spin at 100% without even polling anymore in case a
forced yield was performed.
The problem it tried to address (intercept response data from a request
analyser before forwarding) is not a trivial issue to address since
wakeups based on reads will not necessarily happen unless there's write
activity.
Anyway, if functions are attached specifically to a request or to a
response, it's for a reason. So for now let's be clear about the fact
that it's unreliable to try to process data from the opposite channel
until a better solution is found.
diff --git a/src/hlua.c b/src/hlua.c
index 084b7d5..c08c750 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -3388,9 +3388,9 @@
*/
if (HLUA_IS_WAKERESWR(&s->hlua)) {
s->rep->flags |= CF_WAKE_WRITE;
+ if ((analyzer & (AN_REQ_INSPECT_FE|AN_REQ_HTTP_PROCESS_FE)))
+ s->rep->analysers |= analyzer;
}
- if ((analyzer & (AN_REQ_INSPECT_FE|AN_REQ_HTTP_PROCESS_FE)))
- s->rep->analysers |= analyzer;
if (HLUA_IS_WAKEREQWR(&s->hlua))
s->req->flags |= CF_WAKE_WRITE;
return 0;