mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-13 23:14:46 +00:00
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:
parent
5f2c49f5ee
commit
4d0e263079
47
src/hlua.c
47
src/hlua.c
@ -5996,15 +5996,19 @@ __LJMP static int hlua_txn_done(lua_State *L)
|
||||
ic = &htxn->s->req;
|
||||
oc = &htxn->s->res;
|
||||
|
||||
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;
|
||||
htxn->s->txn->rsp.msg_state = HTTP_MSG_DONE;
|
||||
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;
|
||||
htxn->s->txn->rsp.msg_state = HTTP_MSG_DONE;
|
||||
|
||||
/* Note that if we want to support keep-alive, we need
|
||||
* to bypass the close/shutr_now calls below, but that
|
||||
@ -6012,20 +6016,21 @@ __LJMP static int hlua_txn_done(lua_State *L)
|
||||
* processed and the connection header is known (ie
|
||||
* not during TCP rules).
|
||||
*/
|
||||
}
|
||||
|
||||
channel_auto_read(ic);
|
||||
channel_abort(ic);
|
||||
channel_auto_close(ic);
|
||||
channel_erase(ic);
|
||||
|
||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||
channel_auto_read(oc);
|
||||
channel_auto_close(oc);
|
||||
channel_shutr_now(oc);
|
||||
|
||||
ic->analysers = 0;
|
||||
}
|
||||
|
||||
channel_auto_read(ic);
|
||||
channel_abort(ic);
|
||||
channel_auto_close(ic);
|
||||
channel_erase(ic);
|
||||
|
||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||
channel_auto_read(oc);
|
||||
channel_auto_close(oc);
|
||||
channel_shutr_now(oc);
|
||||
|
||||
ic->analysers = 0;
|
||||
|
||||
hlua->flags |= HLUA_STOP;
|
||||
WILL_LJMP(hlua_done(L));
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user