mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
WIP: stconn: modify sc_attach_mux() to support haload streams
This commit is contained in:
parent
4841613a62
commit
7111cdde39
8
include/haproxy/hldstream.h
Normal file
8
include/haproxy/hldstream.h
Normal 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 */
|
||||
13
src/stconn.c
13
src/stconn.c
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user