mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-03 10:42:07 +00:00
CLEANUP: connection: rename the wait_event.task field to .tasklet
It's really confusing to call it a task because it's a tasklet and used in places where tasks and tasklets are used together. Let's rename it to tasklet to remove this confusion.
This commit is contained in:
parent
95c2c01ced
commit
3c39a7d889
@ -716,9 +716,9 @@ static inline void cs_attach(struct conn_stream *cs, void *data, const struct da
|
||||
|
||||
static inline struct wait_event *wl_set_waitcb(struct wait_event *wl, struct task *(*cb)(struct task *, void *, unsigned short), void *ctx)
|
||||
{
|
||||
if (!wl->task->process) {
|
||||
wl->task->process = cb;
|
||||
wl->task->context = ctx;
|
||||
if (!wl->tasklet->process) {
|
||||
wl->tasklet->process = cb;
|
||||
wl->tasklet->context = ctx;
|
||||
}
|
||||
return wl;
|
||||
}
|
||||
|
@ -122,11 +122,11 @@ static inline int si_reset(struct stream_interface *si)
|
||||
si->end = NULL;
|
||||
si->state = si->prev_state = SI_ST_INI;
|
||||
si->ops = &si_embedded_ops;
|
||||
si->wait_event.task = tasklet_new();
|
||||
if (!si->wait_event.task)
|
||||
si->wait_event.tasklet = tasklet_new();
|
||||
if (!si->wait_event.tasklet)
|
||||
return -1;
|
||||
si->wait_event.task->process = si_cs_io_cb;
|
||||
si->wait_event.task->context = si;
|
||||
si->wait_event.tasklet->process = si_cs_io_cb;
|
||||
si->wait_event.tasklet->context = si;
|
||||
si->wait_event.events = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ enum sub_event_type {
|
||||
};
|
||||
|
||||
struct wait_event {
|
||||
struct tasklet *task;
|
||||
struct tasklet *tasklet;
|
||||
int events; /* set of enum sub_event_type above */
|
||||
};
|
||||
|
||||
|
14
src/checks.c
14
src/checks.c
@ -2254,7 +2254,7 @@ static struct task *process_chk_conn(struct task *t, void *context, unsigned sho
|
||||
* I/O handler expects to have a cs, so remove
|
||||
* the tasklet
|
||||
*/
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.task);
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.tasklet);
|
||||
cs_destroy(cs);
|
||||
cs = check->cs = NULL;
|
||||
conn = NULL;
|
||||
@ -2318,7 +2318,7 @@ static struct task *process_chk_conn(struct task *t, void *context, unsigned sho
|
||||
* I/O handler expects to have a cs, so remove
|
||||
* the tasklet
|
||||
*/
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.task);
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.tasklet);
|
||||
cs_destroy(cs);
|
||||
cs = check->cs = NULL;
|
||||
conn = NULL;
|
||||
@ -2835,7 +2835,7 @@ static int tcpcheck_main(struct check *check)
|
||||
* I/O handler expects to have a cs, so remove
|
||||
* the tasklet
|
||||
*/
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.task);
|
||||
task_remove_from_tasklet_list((struct task *)check->wait_list.tasklet);
|
||||
|
||||
|
||||
cs_destroy(check->cs);
|
||||
@ -3200,12 +3200,12 @@ const char *init_check(struct check *check, int type)
|
||||
if (!check->bi.area || !check->bo.area)
|
||||
return "out of memory while allocating check buffer";
|
||||
|
||||
check->wait_list.task = tasklet_new();
|
||||
if (!check->wait_list.task)
|
||||
check->wait_list.tasklet = tasklet_new();
|
||||
if (!check->wait_list.tasklet)
|
||||
return "out of memroy while allocating check tasklet";
|
||||
check->wait_list.events = 0;
|
||||
check->wait_list.task->process = event_srv_chk_io;
|
||||
check->wait_list.task->context = check;
|
||||
check->wait_list.tasklet->process = event_srv_chk_io;
|
||||
check->wait_list.tasklet->context = check;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ void conn_fd_handler(int fd)
|
||||
flags = 0;
|
||||
if (conn->send_wait != NULL) {
|
||||
conn->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(conn->send_wait->task);
|
||||
tasklet_wakeup(conn->send_wait->tasklet);
|
||||
conn->send_wait = NULL;
|
||||
} else
|
||||
io_available = 1;
|
||||
@ -96,7 +96,7 @@ void conn_fd_handler(int fd)
|
||||
flags = 0;
|
||||
if (conn->recv_wait) {
|
||||
conn->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(conn->recv_wait->task);
|
||||
tasklet_wakeup(conn->recv_wait->tasklet);
|
||||
conn->recv_wait = NULL;
|
||||
} else
|
||||
io_available = 1;
|
||||
|
@ -2361,10 +2361,10 @@ void deinit(void)
|
||||
task_destroy(s->check.task);
|
||||
task_destroy(s->agent.task);
|
||||
|
||||
if (s->check.wait_list.task)
|
||||
tasklet_free(s->check.wait_list.task);
|
||||
if (s->agent.wait_list.task)
|
||||
tasklet_free(s->agent.wait_list.task);
|
||||
if (s->check.wait_list.tasklet)
|
||||
tasklet_free(s->check.wait_list.tasklet);
|
||||
if (s->agent.wait_list.tasklet)
|
||||
tasklet_free(s->agent.wait_list.tasklet);
|
||||
|
||||
task_destroy(s->warmup);
|
||||
|
||||
|
38
src/mux_h1.c
38
src/mux_h1.c
@ -165,13 +165,13 @@ static int h1_buf_available(void *target)
|
||||
if ((h1c->flags & H1C_F_IN_ALLOC) && b_alloc_margin(&h1c->ibuf, 0)) {
|
||||
h1c->flags &= ~H1C_F_IN_ALLOC;
|
||||
if (h1_recv_allowed(h1c))
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((h1c->flags & H1C_F_OUT_ALLOC) && b_alloc_margin(&h1c->obuf, 0)) {
|
||||
h1c->flags &= ~H1C_F_OUT_ALLOC;
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -396,11 +396,11 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
|
||||
h1c->task = NULL;
|
||||
|
||||
LIST_INIT(&h1c->buf_wait.list);
|
||||
h1c->wait_event.task = tasklet_new();
|
||||
if (!h1c->wait_event.task)
|
||||
h1c->wait_event.tasklet = tasklet_new();
|
||||
if (!h1c->wait_event.tasklet)
|
||||
goto fail;
|
||||
h1c->wait_event.task->process = h1_io_cb;
|
||||
h1c->wait_event.task->context = h1c;
|
||||
h1c->wait_event.tasklet->process = h1_io_cb;
|
||||
h1c->wait_event.tasklet->context = h1c;
|
||||
h1c->wait_event.events = 0;
|
||||
|
||||
if (conn_is_back(conn)) {
|
||||
@ -437,15 +437,15 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
|
||||
task_queue(t);
|
||||
|
||||
/* Try to read, if nothing is available yet we'll just subscribe */
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
|
||||
/* mux->wake will be called soon to complete the operation */
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
task_destroy(t);
|
||||
if (h1c->wait_event.task)
|
||||
tasklet_free(h1c->wait_event.task);
|
||||
if (h1c->wait_event.tasklet)
|
||||
tasklet_free(h1c->wait_event.tasklet);
|
||||
pool_free(pool_head_h1c, h1c);
|
||||
fail_h1c:
|
||||
return -1;
|
||||
@ -490,8 +490,8 @@ static void h1_release(struct h1c *h1c)
|
||||
h1c->task = NULL;
|
||||
}
|
||||
|
||||
if (h1c->wait_event.task)
|
||||
tasklet_free(h1c->wait_event.task);
|
||||
if (h1c->wait_event.tasklet)
|
||||
tasklet_free(h1c->wait_event.tasklet);
|
||||
|
||||
h1s_destroy(h1c->h1s);
|
||||
if (conn && h1c->wait_event.events != 0)
|
||||
@ -893,7 +893,7 @@ static void h1_set_res_tunnel_mode(struct h1s *h1s)
|
||||
h1s->req.state = H1_MSG_TUNNEL;
|
||||
if (h1s->h1c->flags & H1C_F_IN_BUSY) {
|
||||
h1s->h1c->flags &= ~H1C_F_IN_BUSY;
|
||||
tasklet_wakeup(h1s->h1c->wait_event.task);
|
||||
tasklet_wakeup(h1s->h1c->wait_event.tasklet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1443,7 +1443,7 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, size_t count
|
||||
ret = htx->data - data;
|
||||
if (h1c->flags & H1C_F_IN_FULL && buf_room_for_htx_data(&h1c->ibuf)) {
|
||||
h1c->flags &= ~H1C_F_IN_FULL;
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
}
|
||||
|
||||
h1s->cs->flags &= ~(CS_FL_RCV_MORE | CS_FL_WANT_ROOM);
|
||||
@ -1776,7 +1776,7 @@ static void h1_wake_stream_for_recv(struct h1s *h1s)
|
||||
{
|
||||
if (h1s && h1s->recv_wait) {
|
||||
h1s->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(h1s->recv_wait->task);
|
||||
tasklet_wakeup(h1s->recv_wait->tasklet);
|
||||
h1s->recv_wait = NULL;
|
||||
}
|
||||
}
|
||||
@ -1784,7 +1784,7 @@ static void h1_wake_stream_for_send(struct h1s *h1s)
|
||||
{
|
||||
if (h1s && h1s->send_wait) {
|
||||
h1s->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(h1s->send_wait->task);
|
||||
tasklet_wakeup(h1s->send_wait->tasklet);
|
||||
h1s->send_wait = NULL;
|
||||
}
|
||||
}
|
||||
@ -2153,7 +2153,7 @@ static void h1_detach(struct conn_stream *cs)
|
||||
/* The server doesn't want it, let's kill the connection right away */
|
||||
h1c->conn->mux->destroy(h1c->conn);
|
||||
else
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
return;
|
||||
|
||||
}
|
||||
@ -2167,7 +2167,7 @@ static void h1_detach(struct conn_stream *cs)
|
||||
/* The connection was added to the server list,
|
||||
* wake the task so we can subscribe to events
|
||||
*/
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2191,7 +2191,7 @@ static void h1_detach(struct conn_stream *cs)
|
||||
(h1c->conn->flags & CO_FL_ERROR) || !h1c->conn->owner)
|
||||
h1_release(h1c);
|
||||
else {
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
if (h1c->task) {
|
||||
h1c->task->expire = TICK_ETERNITY;
|
||||
if (b_data(&h1c->obuf)) {
|
||||
@ -2336,7 +2336,7 @@ static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
||||
else if (ret > 0 || (h1s->flags & H1S_F_SPLICED_DATA)) {
|
||||
h1s->flags &= ~H1S_F_SPLICED_DATA;
|
||||
if (!(h1c->wait_event.events & SUB_RETRY_RECV))
|
||||
tasklet_wakeup(h1c->wait_event.task);
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
56
src/mux_h2.c
56
src/mux_h2.c
@ -361,7 +361,7 @@ static inline void h2c_restart_reading(const struct h2c *h2c, int consider_buffe
|
||||
if ((!consider_buffer || !b_data(&h2c->dbuf))
|
||||
&& (h2c->wait_event.events & SUB_RETRY_RECV))
|
||||
return;
|
||||
tasklet_wakeup(h2c->wait_event.task);
|
||||
tasklet_wakeup(h2c->wait_event.tasklet);
|
||||
}
|
||||
|
||||
|
||||
@ -546,11 +546,11 @@ static int h2_init(struct connection *conn, struct proxy *prx, struct session *s
|
||||
t->expire = tick_add(now_ms, h2c->timeout);
|
||||
}
|
||||
|
||||
h2c->wait_event.task = tasklet_new();
|
||||
if (!h2c->wait_event.task)
|
||||
h2c->wait_event.tasklet = tasklet_new();
|
||||
if (!h2c->wait_event.tasklet)
|
||||
goto fail;
|
||||
h2c->wait_event.task->process = h2_io_cb;
|
||||
h2c->wait_event.task->context = h2c;
|
||||
h2c->wait_event.tasklet->process = h2_io_cb;
|
||||
h2c->wait_event.tasklet->context = h2c;
|
||||
h2c->wait_event.events = 0;
|
||||
|
||||
h2c->ddht = hpack_dht_alloc(h2_settings_header_table_size);
|
||||
@ -611,8 +611,8 @@ static int h2_init(struct connection *conn, struct proxy *prx, struct session *s
|
||||
hpack_dht_free(h2c->ddht);
|
||||
fail:
|
||||
task_destroy(t);
|
||||
if (h2c->wait_event.task)
|
||||
tasklet_free(h2c->wait_event.task);
|
||||
if (h2c->wait_event.tasklet)
|
||||
tasklet_free(h2c->wait_event.tasklet);
|
||||
pool_free(pool_head_h2c, h2c);
|
||||
fail_no_h2c:
|
||||
return -1;
|
||||
@ -676,8 +676,8 @@ static void h2_release(struct h2c *h2c)
|
||||
task_wakeup(h2c->task, TASK_WOKEN_OTHER);
|
||||
h2c->task = NULL;
|
||||
}
|
||||
if (h2c->wait_event.task)
|
||||
tasklet_free(h2c->wait_event.task);
|
||||
if (h2c->wait_event.tasklet)
|
||||
tasklet_free(h2c->wait_event.tasklet);
|
||||
if (h2c->wait_event.events != 0)
|
||||
conn->xprt->unsubscribe(conn, conn->xprt_ctx, h2c->wait_event.events,
|
||||
&h2c->wait_event);
|
||||
@ -749,7 +749,7 @@ static void __maybe_unused h2s_notify_recv(struct h2s *h2s)
|
||||
if (h2s->recv_wait) {
|
||||
sw = h2s->recv_wait;
|
||||
sw->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(sw->task);
|
||||
tasklet_wakeup(sw->tasklet);
|
||||
h2s->recv_wait = NULL;
|
||||
}
|
||||
}
|
||||
@ -763,7 +763,7 @@ static void __maybe_unused h2s_notify_send(struct h2s *h2s)
|
||||
sw = h2s->send_wait;
|
||||
sw->events &= ~SUB_RETRY_SEND;
|
||||
LIST_ADDQ(&h2s->h2c->sending_list, &h2s->sending_list);
|
||||
tasklet_wakeup(sw->task);
|
||||
tasklet_wakeup(sw->tasklet);
|
||||
}
|
||||
}
|
||||
|
||||
@ -911,10 +911,10 @@ static void h2s_destroy(struct h2s *h2s)
|
||||
*/
|
||||
LIST_DEL_INIT(&h2s->list);
|
||||
if (LIST_ADDED(&h2s->sending_list)) {
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->task);
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->tasklet);
|
||||
LIST_DEL_INIT(&h2s->sending_list);
|
||||
}
|
||||
tasklet_free(h2s->wait_event.task);
|
||||
tasklet_free(h2s->wait_event.tasklet);
|
||||
pool_free(pool_head_h2s, h2s);
|
||||
}
|
||||
|
||||
@ -932,15 +932,15 @@ static struct h2s *h2s_new(struct h2c *h2c, int id)
|
||||
if (!h2s)
|
||||
goto out;
|
||||
|
||||
h2s->wait_event.task = tasklet_new();
|
||||
if (!h2s->wait_event.task) {
|
||||
h2s->wait_event.tasklet = tasklet_new();
|
||||
if (!h2s->wait_event.tasklet) {
|
||||
pool_free(pool_head_h2s, h2s);
|
||||
goto out;
|
||||
}
|
||||
h2s->send_wait = NULL;
|
||||
h2s->recv_wait = NULL;
|
||||
h2s->wait_event.task->process = h2_deferred_shut;
|
||||
h2s->wait_event.task->context = h2s;
|
||||
h2s->wait_event.tasklet->process = h2_deferred_shut;
|
||||
h2s->wait_event.tasklet->context = h2s;
|
||||
h2s->wait_event.events = 0;
|
||||
LIST_INIT(&h2s->list);
|
||||
LIST_INIT(&h2s->sending_list);
|
||||
@ -2679,7 +2679,7 @@ static int h2_process_mux(struct h2c *h2c)
|
||||
}
|
||||
h2s->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
LIST_ADDQ(&h2c->sending_list, &h2s->sending_list);
|
||||
tasklet_wakeup(h2s->send_wait->task);
|
||||
tasklet_wakeup(h2s->send_wait->tasklet);
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(h2s, h2s_back, &h2c->send_list, list) {
|
||||
@ -2699,7 +2699,7 @@ static int h2_process_mux(struct h2c *h2c)
|
||||
h2s->flags &= ~H2_SF_BLK_ANY;
|
||||
h2s->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
LIST_ADDQ(&h2c->sending_list, &h2s->sending_list);
|
||||
tasklet_wakeup(h2s->send_wait->task);
|
||||
tasklet_wakeup(h2s->send_wait->tasklet);
|
||||
}
|
||||
|
||||
fail:
|
||||
@ -2884,7 +2884,7 @@ static int h2_send(struct h2c *h2c)
|
||||
}
|
||||
h2s->flags &= ~H2_SF_BLK_ANY;
|
||||
h2s->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(h2s->send_wait->task);
|
||||
tasklet_wakeup(h2s->send_wait->tasklet);
|
||||
LIST_ADDQ(&h2c->sending_list, &h2s->sending_list);
|
||||
}
|
||||
}
|
||||
@ -2898,7 +2898,7 @@ schedule:
|
||||
return sent;
|
||||
}
|
||||
|
||||
/* this is the tasklet referenced in h2c->wait_event.task */
|
||||
/* this is the tasklet referenced in h2c->wait_event.tasklet */
|
||||
static struct task *h2_io_cb(struct task *t, void *ctx, unsigned short status)
|
||||
{
|
||||
struct h2c *h2c = ctx;
|
||||
@ -3144,7 +3144,7 @@ static void h2_detach(struct conn_stream *cs)
|
||||
/* The stream is about to die, so no need to attempt to run its task */
|
||||
if (LIST_ADDED(&h2s->sending_list) &&
|
||||
h2s->send_wait != &h2s->wait_event) {
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->task);
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->tasklet);
|
||||
LIST_DEL_INIT(&h2s->sending_list);
|
||||
/*
|
||||
* At this point, the stream_interface is supposed to have called
|
||||
@ -3277,7 +3277,7 @@ static void h2_do_shutr(struct h2s *h2s)
|
||||
goto add_to_list;
|
||||
|
||||
if (!(h2c->wait_event.events & SUB_RETRY_SEND))
|
||||
tasklet_wakeup(h2c->wait_event.task);
|
||||
tasklet_wakeup(h2c->wait_event.tasklet);
|
||||
h2s_close(h2s);
|
||||
done:
|
||||
h2s->flags &= ~H2_SF_WANT_SHUTR;
|
||||
@ -3346,7 +3346,7 @@ static void h2_do_shutw(struct h2s *h2s)
|
||||
}
|
||||
|
||||
if (!(h2c->wait_event.events & SUB_RETRY_SEND))
|
||||
tasklet_wakeup(h2c->wait_event.task);
|
||||
tasklet_wakeup(h2c->wait_event.tasklet);
|
||||
done:
|
||||
h2s->flags &= ~H2_SF_WANT_SHUTW;
|
||||
return;
|
||||
@ -3367,7 +3367,7 @@ static void h2_do_shutw(struct h2s *h2s)
|
||||
return;
|
||||
}
|
||||
|
||||
/* This is the tasklet referenced in h2s->wait_event.task, it is used for
|
||||
/* This is the tasklet referenced in h2s->wait_event.tasklet, it is used for
|
||||
* deferred shutdowns when the h2_detach() was done but the mux buffer was full
|
||||
* and prevented the last frame from being emitted.
|
||||
*/
|
||||
@ -5346,7 +5346,7 @@ static int h2_unsubscribe(struct conn_stream *cs, int event_type, void *param)
|
||||
/* We were about to send, make sure it does not happen */
|
||||
if (LIST_ADDED(&h2s->sending_list) &&
|
||||
h2s->send_wait != &h2s->wait_event) {
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->task);
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->tasklet);
|
||||
LIST_DEL_INIT(&h2s->sending_list);
|
||||
}
|
||||
h2s->send_wait = NULL;
|
||||
@ -5439,7 +5439,7 @@ static void h2_stop_senders(struct h2c *h2c)
|
||||
|
||||
list_for_each_entry_safe(h2s, h2s_back, &h2c->sending_list, sending_list) {
|
||||
LIST_DEL_INIT(&h2s->sending_list);
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->task);
|
||||
task_remove_from_tasklet_list((struct task *)h2s->send_wait->tasklet);
|
||||
h2s->send_wait->events |= SUB_RETRY_SEND;
|
||||
}
|
||||
}
|
||||
@ -5647,7 +5647,7 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
||||
|
||||
if (total > 0) {
|
||||
if (!(h2s->h2c->wait_event.events & SUB_RETRY_SEND))
|
||||
tasklet_wakeup(h2s->h2c->wait_event.task);
|
||||
tasklet_wakeup(h2s->h2c->wait_event.tasklet);
|
||||
|
||||
}
|
||||
/* If we're waiting for flow control, and we got a shutr on the
|
||||
|
14
src/mux_pt.c
14
src/mux_pt.c
@ -32,7 +32,7 @@ static void mux_pt_destroy(struct mux_pt_ctx *ctx)
|
||||
|
||||
conn_stop_tracking(conn);
|
||||
conn_full_close(conn);
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
conn->mux = NULL;
|
||||
conn->ctx = NULL;
|
||||
if (conn->destroy_cb)
|
||||
@ -74,11 +74,11 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio
|
||||
if (!ctx)
|
||||
goto fail;
|
||||
|
||||
ctx->wait_event.task = tasklet_new();
|
||||
if (!ctx->wait_event.task)
|
||||
ctx->wait_event.tasklet = tasklet_new();
|
||||
if (!ctx->wait_event.tasklet)
|
||||
goto fail_free_ctx;
|
||||
ctx->wait_event.task->context = ctx;
|
||||
ctx->wait_event.task->process = mux_pt_io_cb;
|
||||
ctx->wait_event.tasklet->context = ctx;
|
||||
ctx->wait_event.tasklet->process = mux_pt_io_cb;
|
||||
ctx->wait_event.events = 0;
|
||||
ctx->conn = conn;
|
||||
|
||||
@ -99,8 +99,8 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio
|
||||
fail_free:
|
||||
cs_free(cs);
|
||||
fail_free_ctx:
|
||||
if (ctx->wait_event.task)
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
if (ctx->wait_event.tasklet)
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(pool_head_pt_ctx, ctx);
|
||||
fail:
|
||||
return -1;
|
||||
|
@ -5110,14 +5110,14 @@ static int ssl_sock_init(struct connection *conn, void **xprt_ctx)
|
||||
conn->err_code = CO_ER_SSL_NO_MEM;
|
||||
return -1;
|
||||
}
|
||||
ctx->wait_event.task = tasklet_new();
|
||||
if (!ctx->wait_event.task) {
|
||||
ctx->wait_event.tasklet = tasklet_new();
|
||||
if (!ctx->wait_event.tasklet) {
|
||||
conn->err_code = CO_ER_SSL_NO_MEM;
|
||||
pool_free(ssl_sock_ctx_pool, ctx);
|
||||
return -1;
|
||||
}
|
||||
ctx->wait_event.task->process = ssl_sock_io_cb;
|
||||
ctx->wait_event.task->context = ctx;
|
||||
ctx->wait_event.tasklet->process = ssl_sock_io_cb;
|
||||
ctx->wait_event.tasklet->context = ctx;
|
||||
ctx->wait_event.events = 0;
|
||||
ctx->sent_early_data = 0;
|
||||
ctx->tmp_early_data = -1;
|
||||
@ -5200,7 +5200,7 @@ static int ssl_sock_init(struct connection *conn, void **xprt_ctx)
|
||||
_HA_ATOMIC_ADD(&totalsslconns, 1);
|
||||
*xprt_ctx = ctx;
|
||||
/* Start the handshake */
|
||||
tasklet_wakeup(ctx->wait_event.task);
|
||||
tasklet_wakeup(ctx->wait_event.tasklet);
|
||||
if (conn->flags & CO_FL_ERROR)
|
||||
goto err;
|
||||
return 0;
|
||||
@ -5256,7 +5256,7 @@ static int ssl_sock_init(struct connection *conn, void **xprt_ctx)
|
||||
_HA_ATOMIC_ADD(&totalsslconns, 1);
|
||||
*xprt_ctx = ctx;
|
||||
/* Start the handshake */
|
||||
tasklet_wakeup(ctx->wait_event.task);
|
||||
tasklet_wakeup(ctx->wait_event.tasklet);
|
||||
if (conn->flags & CO_FL_ERROR)
|
||||
goto err;
|
||||
return 0;
|
||||
@ -5264,8 +5264,8 @@ static int ssl_sock_init(struct connection *conn, void **xprt_ctx)
|
||||
/* don't know how to handle such a target */
|
||||
conn->err_code = CO_ER_SSL_NO_TARGET;
|
||||
err:
|
||||
if (ctx && ctx->wait_event.task)
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
if (ctx && ctx->wait_event.tasklet)
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(ssl_sock_ctx_pool, ctx);
|
||||
return -1;
|
||||
}
|
||||
@ -5667,13 +5667,13 @@ static struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned short
|
||||
/* On error, wake any waiter */
|
||||
if (ctx->recv_wait) {
|
||||
ctx->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(ctx->recv_wait->task);
|
||||
tasklet_wakeup(ctx->recv_wait->tasklet);
|
||||
ctx->recv_wait = NULL;
|
||||
woke = 1;
|
||||
}
|
||||
if (ctx->send_wait) {
|
||||
ctx->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(ctx->send_wait->task);
|
||||
tasklet_wakeup(ctx->send_wait->tasklet);
|
||||
ctx->send_wait = NULL;
|
||||
woke = 1;
|
||||
}
|
||||
@ -6005,11 +6005,11 @@ static void ssl_sock_close(struct connection *conn, void *xprt_ctx) {
|
||||
&ctx->wait_event);
|
||||
if (ctx->send_wait) {
|
||||
ctx->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(ctx->send_wait->task);
|
||||
tasklet_wakeup(ctx->send_wait->tasklet);
|
||||
}
|
||||
if (ctx->recv_wait) {
|
||||
ctx->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(ctx->recv_wait->task);
|
||||
tasklet_wakeup(ctx->recv_wait->tasklet);
|
||||
}
|
||||
if (ctx->xprt->close)
|
||||
ctx->xprt->close(conn, ctx->xprt_ctx);
|
||||
@ -6044,7 +6044,7 @@ static void ssl_sock_close(struct connection *conn, void *xprt_ctx) {
|
||||
*/
|
||||
fd_cant_recv(afd);
|
||||
}
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(ssl_sock_ctx_pool, ctx);
|
||||
_HA_ATOMIC_ADD(&jobs, 1);
|
||||
return;
|
||||
@ -6060,7 +6060,7 @@ static void ssl_sock_close(struct connection *conn, void *xprt_ctx) {
|
||||
}
|
||||
#endif
|
||||
SSL_free(ctx->ssl);
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(ssl_sock_ctx_pool, ctx);
|
||||
_HA_ATOMIC_SUB(&sslconns, 1);
|
||||
}
|
||||
|
@ -344,10 +344,10 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
|
||||
out_fail_accept:
|
||||
flt_stream_release(s, 0);
|
||||
task_destroy(t);
|
||||
tasklet_free(s->si[1].wait_event.task);
|
||||
tasklet_free(s->si[1].wait_event.tasklet);
|
||||
LIST_DEL(&s->list);
|
||||
out_fail_alloc_si1:
|
||||
tasklet_free(s->si[0].wait_event.task);
|
||||
tasklet_free(s->si[0].wait_event.tasklet);
|
||||
out_fail_alloc:
|
||||
pool_free(pool_head_stream, s);
|
||||
return NULL;
|
||||
@ -480,8 +480,8 @@ static void stream_free(struct stream *s)
|
||||
si_release_endpoint(&s->si[1]);
|
||||
si_release_endpoint(&s->si[0]);
|
||||
|
||||
tasklet_free(s->si[0].wait_event.task);
|
||||
tasklet_free(s->si[1].wait_event.task);
|
||||
tasklet_free(s->si[0].wait_event.tasklet);
|
||||
tasklet_free(s->si[1].wait_event.tasklet);
|
||||
|
||||
b_free(&s->si[1].l7_buffer);
|
||||
if (must_free_sess) {
|
||||
|
@ -264,7 +264,7 @@ static void stream_int_chk_rcv(struct stream_interface *si)
|
||||
}
|
||||
else {
|
||||
/* (re)start reading */
|
||||
tasklet_wakeup(si->wait_event.task);
|
||||
tasklet_wakeup(si->wait_event.tasklet);
|
||||
if (!(si->flags & SI_FL_DONT_WAKE))
|
||||
task_wakeup(si_task(si), TASK_WOKEN_IO);
|
||||
}
|
||||
@ -1096,7 +1096,7 @@ static void stream_int_chk_rcv_conn(struct stream_interface *si)
|
||||
{
|
||||
/* (re)start reading */
|
||||
if (si_state_in(si->state, SI_SB_CON|SI_SB_RDY|SI_SB_EST))
|
||||
tasklet_wakeup(si->wait_event.task);
|
||||
tasklet_wakeup(si->wait_event.tasklet);
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,13 +90,13 @@ out:
|
||||
/* On error, wake any waiter */
|
||||
if (ctx->recv_wait) {
|
||||
ctx->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(ctx->recv_wait->task);
|
||||
tasklet_wakeup(ctx->recv_wait->tasklet);
|
||||
woke = 1;
|
||||
ctx->recv_wait = NULL;
|
||||
}
|
||||
if (ctx->send_wait) {
|
||||
ctx->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(ctx->send_wait->task);
|
||||
tasklet_wakeup(ctx->send_wait->tasklet);
|
||||
woke = 1;
|
||||
ctx->send_wait = NULL;
|
||||
}
|
||||
@ -126,7 +126,7 @@ out:
|
||||
if (ret >= 0 && !woke && ctx->conn->mux && ctx->conn->mux->wake)
|
||||
ret = ctx->conn->mux->wake(ctx->conn);
|
||||
}
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(xprt_handshake_ctx_pool, ctx);
|
||||
}
|
||||
return NULL;
|
||||
@ -147,14 +147,14 @@ static int xprt_handshake_init(struct connection *conn, void **xprt_ctx)
|
||||
return -1;
|
||||
}
|
||||
ctx->conn = conn;
|
||||
ctx->wait_event.task = tasklet_new();
|
||||
if (!ctx->wait_event.task) {
|
||||
ctx->wait_event.tasklet = tasklet_new();
|
||||
if (!ctx->wait_event.tasklet) {
|
||||
conn->err_code = CO_ER_SSL_NO_MEM;
|
||||
pool_free(xprt_handshake_ctx_pool, ctx);
|
||||
return -1;
|
||||
}
|
||||
ctx->wait_event.task->process = xprt_handshake_io_cb;
|
||||
ctx->wait_event.task->context = ctx;
|
||||
ctx->wait_event.tasklet->process = xprt_handshake_io_cb;
|
||||
ctx->wait_event.tasklet->context = ctx;
|
||||
ctx->wait_event.events = 0;
|
||||
/* This XPRT expects the underlying XPRT to be provided later,
|
||||
* with an add_xprt() call, so we start trying to do the handshake
|
||||
@ -179,11 +179,11 @@ static void xprt_handshake_close(struct connection *conn, void *xprt_ctx)
|
||||
&ctx->wait_event);
|
||||
if (ctx->send_wait) {
|
||||
ctx->send_wait->events &= ~SUB_RETRY_SEND;
|
||||
tasklet_wakeup(ctx->send_wait->task);
|
||||
tasklet_wakeup(ctx->send_wait->tasklet);
|
||||
}
|
||||
if (ctx->recv_wait) {
|
||||
ctx->recv_wait->events &= ~SUB_RETRY_RECV;
|
||||
tasklet_wakeup(ctx->recv_wait->task);
|
||||
tasklet_wakeup(ctx->recv_wait->tasklet);
|
||||
}
|
||||
|
||||
if (ctx->xprt && ctx->xprt->close)
|
||||
@ -199,7 +199,7 @@ static void xprt_handshake_close(struct connection *conn, void *xprt_ctx)
|
||||
conn->flags &= ~CO_FL_HANDSHAKE_NOSSL;
|
||||
if (conn->xprt == xprt_get(XPRT_HANDSHAKE))
|
||||
conn->xprt = xprt_get(XPRT_RAW);
|
||||
tasklet_free(ctx->wait_event.task);
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
pool_free(xprt_handshake_ctx_pool, ctx);
|
||||
}
|
||||
}
|
||||
@ -263,7 +263,7 @@ static int xprt_handshake_add_xprt(struct connection *conn, void *xprt_ctx, void
|
||||
ctx->xprt = toadd_ops;
|
||||
ctx->xprt_ctx = toadd_ctx;
|
||||
/* Ok we know have an xprt, so let's try to do the handshake */
|
||||
tasklet_wakeup(ctx->wait_event.task);
|
||||
tasklet_wakeup(ctx->wait_event.tasklet);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user