From ac6322dd36f51487e62d02ad01ddb36f008c6ea9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 29 Jan 2021 12:33:46 +0100 Subject: [PATCH] MINOR: muxes: export the timeout and shutr task handlers These ones appear often in "show tasks" so it's handy to make them resolve. --- src/mux_fcgi.c | 8 ++++---- src/mux_h1.c | 4 ++-- src/mux_h2.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index d45951b3e..3e1cff852 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -353,12 +353,12 @@ INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE); DECLARE_STATIC_POOL(pool_head_fcgi_conn, "fcgi_conn", sizeof(struct fcgi_conn)); DECLARE_STATIC_POOL(pool_head_fcgi_strm, "fcgi_strm", sizeof(struct fcgi_strm)); -static struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state); +struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state); static int fcgi_process(struct fcgi_conn *fconn); /* fcgi_io_cb is exported to see it resolved in "show fd" */ struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned short state); static inline struct fcgi_strm *fcgi_conn_st_by_id(struct fcgi_conn *fconn, int id); -static struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state); +struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state); static struct fcgi_strm *fcgi_conn_stream_new(struct fcgi_conn *fconn, struct conn_stream *cs, struct session *sess); static void fcgi_strm_notify_recv(struct fcgi_strm *fstrm); static void fcgi_strm_notify_send(struct fcgi_strm *fstrm); @@ -3146,7 +3146,7 @@ static int fcgi_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *ou * immediately killed. If it's allocatable and empty, we attempt to send a * ABORT records. */ -static struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state) +struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state) { struct fcgi_conn *fconn = context; int expired = tick_is_expired(t->expire, now_ms); @@ -3755,7 +3755,7 @@ static void fcgi_do_shutw(struct fcgi_strm *fstrm) * deferred shutdowns when the fcgi_detach() was done but the mux buffer was full * and prevented the last record from being emitted. */ -static struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state) +struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state) { struct fcgi_strm *fstrm = ctx; struct fcgi_conn *fconn = fstrm->fconn; diff --git a/src/mux_h1.c b/src/mux_h1.c index 5c826c677..0a334278c 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -267,7 +267,7 @@ static int h1_send(struct h1c *h1c); static int h1_process(struct h1c *h1c); /* h1_io_cb is exported to see it resolved in "show fd" */ struct task *h1_io_cb(struct task *t, void *ctx, unsigned short state); -static struct task *h1_timeout_task(struct task *t, void *context, unsigned short state); +struct task *h1_timeout_task(struct task *t, void *context, unsigned short state); static void h1_shutw_conn(struct connection *conn, enum cs_shw_mode mode); static void h1_wake_stream_for_recv(struct h1s *h1s); static void h1_wake_stream_for_send(struct h1s *h1s); @@ -2871,7 +2871,7 @@ static int h1_wake(struct connection *conn) /* Connection timeout management. The principle is that if there's no receipt * nor sending for a certain amount of time, the connection is closed. */ -static struct task *h1_timeout_task(struct task *t, void *context, unsigned short state) +struct task *h1_timeout_task(struct task *t, void *context, unsigned short state) { struct h1c *h1c = context; int expired = tick_is_expired(t->expire, now_ms); diff --git a/src/mux_h2.c b/src/mux_h2.c index b067f2978..55c08f74b 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -551,7 +551,7 @@ static const struct h2s *h2_idle_stream = &(const struct h2s){ .id = 0, }; -static struct task *h2_timeout_task(struct task *t, void *context, unsigned short state); +struct task *h2_timeout_task(struct task *t, void *context, unsigned short state); static int h2_send(struct h2c *h2c); static int h2_recv(struct h2c *h2c); static int h2_process(struct h2c *h2c); @@ -560,7 +560,7 @@ struct task *h2_io_cb(struct task *t, void *ctx, unsigned short state); static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id); static int h2c_decode_headers(struct h2c *h2c, struct buffer *rxbuf, uint32_t *flags, unsigned long long *body_len, char *upgrade_protocol); static int h2_frt_transfer_data(struct h2s *h2s); -static struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state); +struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state); static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct conn_stream *cs, struct session *sess); static void h2s_alert(struct h2s *h2s); @@ -3956,7 +3956,7 @@ static int h2_wake(struct connection *conn) * immediately killed. If it's allocatable and empty, we attempt to send a * GOAWAY frame. */ -static struct task *h2_timeout_task(struct task *t, void *context, unsigned short state) +struct task *h2_timeout_task(struct task *t, void *context, unsigned short state) { struct h2c *h2c = context; int expired = tick_is_expired(t->expire, now_ms); @@ -4420,7 +4420,7 @@ static void h2_do_shutw(struct h2s *h2s) * deferred shutdowns when the h2_detach() was done but the mux buffer was full * and prevented the last frame from being emitted. */ -static struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state) +struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state) { struct h2s *h2s = ctx; struct h2c *h2c = h2s->h2c;