]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: the lua fucntion Channel:close() causes a segfault
authorThierry FOURNIER <tfournier@arpalert.org>
Mon, 24 Aug 2015 15:23:45 +0000 (17:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Aug 2015 16:24:11 +0000 (18:24 +0200)
The function dont remove remaineing analysers and dont update response
channel timeout.

The fix is a copy of the behavior of the functions http_apply_redirect_rule()
and stream_int_retnclose().

src/hlua.c

index abfb2b574123ed037908ac77abfb668abf6fab75..84aee63307f52a2b601ca90a774d22dcf782abf0 100644 (file)
@@ -3621,13 +3621,17 @@ __LJMP static int hlua_txn_close(lua_State *L)
        ic = &htxn->s->req;
        oc = &htxn->s->res;
 
+       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);
 
+       htxn->s->txn->req.chn->analysers = 0;
        return 0;
 }