BUG/MINOR: hlua: Make the function txn:done() HTX aware

The function hlua_txn_done() still relying, for the HTTP, on the legacy HTTP
mode. Now, for HTX streams, it calls the function htx_reply_and_close().

This patch must be backported to 2.0 and 1.9.
This commit is contained in:
Christopher Faulet 2019-07-16 10:52:40 +02:00
parent 5f2c49f5ee
commit 4d0e263079

View File

@ -5996,11 +5996,15 @@ __LJMP static int hlua_txn_done(lua_State *L)
ic = &htxn->s->req;
oc = &htxn->s->res;
if (IS_HTX_STRM(htxn->s))
htx_reply_and_close(htxn->s, 0, NULL);
else {
if (htxn->s->txn) {
/* HTTP mode, let's stay in sync with the stream */
b_del(&ic->buf, htxn->s->txn->req.sov);
htxn->s->txn->req.next -= htxn->s->txn->req.sov;
htxn->s->txn->req.sov = 0;
ic->analysers &= AN_REQ_HTTP_XFER_BODY;
oc->analysers = AN_RES_HTTP_XFER_BODY;
htxn->s->txn->req.msg_state = HTTP_MSG_CLOSED;
@ -6025,6 +6029,7 @@ __LJMP static int hlua_txn_done(lua_State *L)
channel_shutr_now(oc);
ic->analysers = 0;
}
hlua->flags |= HLUA_STOP;
WILL_LJMP(hlua_done(L));