]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: hlua: Apply socket timeout on server side only
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 Jul 2026 09:49:32 +0000 (11:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 Jul 2026 09:49:36 +0000 (11:49 +0200)
In lua, the timeout that can be set on an Socket applet was applied on
client side and server side. In fact, it must only be applied on server
side, to apply a timeout on the connection. The client side is the applet.

This patch should fix the issue #3442. It must be backported to all
supported versions.

src/hlua.c

index c50fb20b1d0963a44c9006f65e6a996cf04d7cfa..38f82182e61b2f52dbd8cd32c1785a1200d6890b 100644 (file)
@@ -2744,7 +2744,6 @@ static int hlua_socket_init(struct appctx *appctx)
 
        if (csk_ctx->timeout) {
                s->sess->fe->timeout.connect = csk_ctx->timeout;
-               s->scf->ioto = csk_ctx->timeout;
                s->scb->ioto = csk_ctx->timeout;
        }
 
@@ -3722,7 +3721,6 @@ __LJMP static int hlua_socket_settimeout(struct lua_State *L)
        s = appctx_strm(csk_ctx->appctx);
 
        s->sess->fe->timeout.connect = tmout;
-       s->scf->ioto = tmout;
        s->scb->ioto = tmout;
 
        s->task->expire = (tick_is_expired(s->task->expire, now_ms) ? 0 : s->task->expire);