Hi,

On keep-alive connections, the frontend SC's SC_FL_ERROR flag from a
previous request's processing can persist into the next request. When
that next request runs http-req rules containing a yielding action (e.g.
a Lua httpclient call), http_req_get_intercept_rule() sees the stale
flag and sets ACT_OPT_FINAL_EARLY on the first call, preventing the
yield and silently aborting the action.

Commit 84b952515 (mux-fcgi drain fix) makes this more likely by
accelerating stream cleanup, which triggers SC_FL_ERROR propagation on
the frontend SC during the response phase.

Fix by only checking these flags on resume (s->current_rule is set), not
on the first call where the flags are stale from a previous request.

--yas

--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -2834,7 +2834,7 @@ static enum rule_result http_req_get_intercept_rule(...)
        enum rule_result rule_ret = HTTP_RULE_RES_CONT;
        int act_opts = 0;
 
-       if ((s->scf->flags & SC_FL_ERROR) ||
+       if (s->current_rule &&
+           ((s->scf->flags & SC_FL_ERROR) ||
            ((s->scf->flags & SC_FL_EOS) && proxy_abrt_close_def(px, 1))))
                act_opts |= ACT_OPT_FINAL | ACT_OPT_FINAL_EARLY;


Reply via email to