From 26ce14ea826ae7e0c3428f389d00a8316963df00 Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Mon, 22 Jun 2026 10:22:17 +0200 Subject: [PATCH] fix: too much connection with -m option this is due to recent modifs, where the stream expiration info has been moved to the hldstream struct (we do no more rely on the underlying task expiration). But this expiration was not initialized and taken as expiration value for the user task, leading this user task to be wake up as soon as the first stream is intantiated. This is not correct. The user task must wait for the connection establishment. --- src/haload.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/haload.c b/src/haload.c index 0fb3e4cc0..f4fc1565b 100644 --- a/src/haload.c +++ b/src/haload.c @@ -1327,9 +1327,10 @@ static struct hldstream *hld_new_strm(struct hld_usr *usr, t->context = hs; t->process = hld_strm_task; - t->expire = TICK_ETERNITY;//tick_add(now_ms, MS_TO_TICKS(arg_wait)); + t->expire = TICK_ETERNITY; hs->conn = conn; + hs->expire = tick_add(now_ms, MS_TO_TICKS(arg_wait)); hs->hash = hash; hs->usr = usr; hs->url = url; @@ -1470,6 +1471,7 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta if (!LIST_ISEMPTY(&usr->strms)) { struct hldstream *first_hs = LIST_ELEM(usr->strms.n, struct hldstream *, list); + BUG_ON(tick_is_expired(first_hs->expire, now_ms)); usr->task->expire = first_hs->expire; } -- 2.47.3