WIP: stconn: modify sc_attach_mux() to support haload streams

This commit is contained in:
Frederic Lecaille 2026-04-16 08:00:23 +02:00
parent 4841613a62
commit 7111cdde39
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#ifndef _HAPROXY_HLDSTREAM_H
#define _HAPROXY_HLDSTREAM_H
#include <haproxy/hldstream-t.h>
struct task *hld_io_cb(struct task *t, void *context, unsigned int state);
#endif /* _HAPROXY_HLDSTREAM_H */

View File

@ -17,6 +17,7 @@
#include <haproxy/check.h>
#include <haproxy/filters.h>
#include <haproxy/hstream.h>
#include <haproxy/hldstream.h>
#include <haproxy/http_ana.h>
#include <haproxy/pipe.h>
#include <haproxy/pool.h>
@ -31,6 +32,8 @@ DECLARE_TYPED_POOL(pool_head_sedesc, "sedesc", struct sedesc);
static int sc_conn_recv(struct stconn *sc);
static int sc_conn_send(struct stconn *sc);
extern __attribute__((weak))
struct task *hld_io_cb(struct task *t, void *context, unsigned int state);
/* Initializes an endpoint */
void sedesc_init(struct sedesc *sedesc)
@ -298,6 +301,16 @@ int sc_attach_mux(struct stconn *sc, void *sd, void *ctx)
sc->wait_event.events = 0;
}
}
else if (sc_hldstream(sc)) {
if (!sc->wait_event.tasklet) {
sc->wait_event.tasklet = tasklet_new();
if (!sc->wait_event.tasklet)
return -1;
sc->wait_event.tasklet->process = hld_io_cb;
sc->wait_event.tasklet->context = sc;
sc->wait_event.events = 0;
}
}
sedesc->se = sd;
sedesc->conn = ctx;