mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-25 06:53:03 +00:00
BUG/MAJOR: lua: Do not force the HTTP analysers in use-services
INNER and XFERBODY analyzer were set in order to support HTTP applets from TCP rulesets, but this does not work (cf previous patch). Other cases already provides theses analyzers, so their addition is not needed. Furthermore if INNER was set it could cause some headers to be rewritten (ex: connection) after headers were already forwarded, resulting in a crash in buffer_insert_line2(). Special thanks to Bernd Helm for providing very detailed information, captures and stack traces making it possible to spot the root cause here. This fix must be backported to 1.6.
This commit is contained in:
parent
718e2a73a2
commit
52e2606188
@ -5781,7 +5781,6 @@ static int hlua_applet_http_init(struct appctx *ctx, struct proxy *px, struct st
|
||||
*/
|
||||
if ((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL)
|
||||
txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_SCL;
|
||||
req->analysers |= AN_REQ_HTTP_XFER_BODY;
|
||||
|
||||
HLUA_INIT(hlua);
|
||||
ctx->ctx.hlua_apphttp.left_bytes = -1;
|
||||
@ -5876,7 +5875,6 @@ static void hlua_applet_http_fct(struct appctx *ctx)
|
||||
struct stream_interface *si = ctx->owner;
|
||||
struct stream *strm = si_strm(si);
|
||||
struct channel *res = si_ic(si);
|
||||
struct channel *req = si_oc(si);
|
||||
struct act_rule *rule = ctx->rule;
|
||||
struct proxy *px = strm->be;
|
||||
struct hlua *hlua = &ctx->ctx.hlua_apphttp.hlua;
|
||||
@ -5894,12 +5892,6 @@ static void hlua_applet_http_fct(struct appctx *ctx)
|
||||
if (!HLUA_IS_RUNNING(hlua) &&
|
||||
!(ctx->ctx.hlua_apphttp.flags & APPLET_DONE)) {
|
||||
|
||||
/* enable the minimally required analyzers to handle keep-alive
|
||||
* and compression on the HTTP response
|
||||
*/
|
||||
req->analysers = (req->analysers & AN_REQ_HTTP_BODY) |
|
||||
AN_REQ_HTTP_XFER_BODY | AN_REQ_HTTP_INNER;
|
||||
|
||||
/* Wait for full HTTP analysys. */
|
||||
if (unlikely(strm->txn->req.msg_state < HTTP_MSG_BODY)) {
|
||||
si_applet_cant_get(si);
|
||||
|
Loading…
Reference in New Issue
Block a user