mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MEDIUM: hlua: Make sure we drain the output buffer when done.
In hlua_applet_tcp_fct(), drain the output buffer when the applet is done running, every time we're called. Overwise, there's a race condition, and the output buffer could be filled after the applet ran, and as it is never cleared, the stream interface will never be destroyed. This should be backported to 1.8 and 1.7.
This commit is contained in:
parent
155e93e570
commit
594c8c5015
@ -6446,8 +6446,11 @@ static void hlua_applet_tcp_fct(struct appctx *ctx)
|
|||||||
struct hlua *hlua = ctx->ctx.hlua_apptcp.hlua;
|
struct hlua *hlua = ctx->ctx.hlua_apptcp.hlua;
|
||||||
|
|
||||||
/* The applet execution is already done. */
|
/* The applet execution is already done. */
|
||||||
if (ctx->ctx.hlua_apptcp.flags & APPLET_DONE)
|
if (ctx->ctx.hlua_apptcp.flags & APPLET_DONE) {
|
||||||
|
/* eat the whole request */
|
||||||
|
co_skip(si_oc(si), co_data(si_oc(si)));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the stream is disconnect or closed, ldo nothing. */
|
/* If the stream is disconnect or closed, ldo nothing. */
|
||||||
if (unlikely(si->state == SI_ST_DIS || si->state == SI_ST_CLO))
|
if (unlikely(si->state == SI_ST_DIS || si->state == SI_ST_CLO))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user