]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: rename the wait_event.task field to .tasklet
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Jun 2019 12:42:29 +0000 (14:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Jun 2019 12:42:29 +0000 (14:42 +0200)
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.

13 files changed:
include/proto/connection.h
include/proto/stream_interface.h
include/types/connection.h
src/checks.c
src/connection.c
src/haproxy.c
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c
src/ssl_sock.c
src/stream.c
src/stream_interface.c
src/xprt_handshake.c

index 67177c5627b68033945137b8ee4d1be244edc0b9..115e7aaa3bc9a03b993b23d8363bc51d6a246387 100644 (file)
@@ -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;
 }
index 50373ac720555dc21eca2c51205dfac851dc3a31..63f1738bcc9d75887ba7d23082d60f9ccdcf901d 100644 (file)
@@ -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;
 }
index 54f8d1a3391f4961ff5d4257769d9450a51edd7b..cc2fb17b473524411da148935c0629586f730a53 100644 (file)
@@ -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 */
 };
 
index 308b4b724aa9ceaf54557f55cdd729f55310246a..e1a2e68700b822a0b9fd63be8972daa6d314e13c 100644 (file)
@@ -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;
 }
 
index 380d58c5b5e3b4bd927b1241c5262f741fd06903..4d6d4d584ab87da44d406d955eebc06828ab5370 100644 (file)
@@ -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;
index 9821765a4599a5117582361b869210571c9b1ff3..c9b61c6a22f540c77b38ac7a1263e7c85fea2c98 100644 (file)
@@ -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);
 
index 638d2036740f8ecb6a3d99a612bd5bc078333cc8..0273f881f52047c71c7c31bf93ea6f798d973393 100644 (file)
@@ -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;
 }
index c1ee2c4e69234ff2d047a92f2543e4cbf28a9309..9fb222ee75837d8fa1fdaf96d9ab215fad0a4289 100644 (file)
@@ -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
index 1c1dd7f37db1147a0029e11f8c4cef6a26a24bfd..47d0634bd85b6df5f681e6569b6a6fa13bf78447 100644 (file)
@@ -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;
index b6364faa70f9e8df1bd4a15c69602f0211718398..8c3600a13f5d820a1df275b44dc1689b327e8d07 100644 (file)
@@ -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);
        }
index e536ee2ef8c1d2f26b1b33466cd84a888bdc335f..69befbdd08635a73b4c9ee7653470d7ab47f6015 100644 (file)
@@ -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) {
index b5c3247e2eb3a9fce1e1a2529c3d0c8a71df2e53..8f89dbaea6ff7084e4c881c1f817c5471a144ec5 100644 (file)
@@ -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);
 }
 
 
index 2770385c52f4ef7a693a2abc19ff6e84b36c9ccc..420a1400713a20464820ffb060eada68b9cf12c0 100644 (file)
@@ -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;
 }