]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: httpclient/lua: stuck when closing without data
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 15 Mar 2022 09:52:07 +0000 (10:52 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 15 Mar 2022 10:42:38 +0000 (11:42 +0100)
The httpclient lua code is lacking the end callback, which means it
won't be able to wake up the lua code after a longjmp if the connection
was closed without any data.

Must be backported to 2.5.

src/hlua.c

index 34d271f685e1ffd0837d3a6bdeeaa5cd24cd9b03..b8dd0c7598e59ce92b9de2671ec5d6d6c8ad6206 100644 (file)
@@ -7293,6 +7293,7 @@ __LJMP static int hlua_httpclient_send(lua_State *L, enum http_meth_t meth)
        hlua_hc->hc->ops.res_stline = hlua_httpclient_cb;
        hlua_hc->hc->ops.res_headers = hlua_httpclient_cb;
        hlua_hc->hc->ops.res_payload = hlua_httpclient_cb;
+       hlua_hc->hc->ops.res_end = hlua_httpclient_cb;
 
        /* a body is available, it will use the request callback */
        if (body_str) {