From 8bdb5c9bb4bd499e4c9f55e5991ad7cd2d2ad7f4 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 13 May 2019 18:27:59 +0200 Subject: [PATCH] CLEANUP: connection: remove the handle field from the wait_event struct It was only set and not consumed after the previous change. The reason is that the task's context always contains the relevant information, so there is no need for a second pointer. --- include/types/connection.h | 1 - src/mux_h1.c | 2 -- src/mux_h2.c | 3 --- 3 files changed, 6 deletions(-) diff --git a/include/types/connection.h b/include/types/connection.h index 308be7d7f..be590f098 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -57,7 +57,6 @@ enum sub_event_type { struct wait_event { struct tasklet *task; - void *handle; /* To be used by the callee */ int events; /* set of enum sub_event_type above */ }; diff --git a/src/mux_h1.c b/src/mux_h1.c index d91f45d78..e3f104f49 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2207,7 +2207,6 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, void *param) sw = param; if (!(sw->events & SUB_RETRY_RECV)) { sw->events |= SUB_RETRY_RECV; - sw->handle = h1s; h1s->recv_wait = sw; } return 0; @@ -2215,7 +2214,6 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, void *param) sw = param; if (!(sw->events & SUB_RETRY_SEND)) { sw->events |= SUB_RETRY_SEND; - sw->handle = h1s; h1s->send_wait = sw; } return 0; diff --git a/src/mux_h2.c b/src/mux_h2.c index f5a153170..8c73cce45 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -909,7 +909,6 @@ static struct h2s *h2s_new(struct h2c *h2c, int id) h2s->recv_wait = NULL; h2s->wait_event.task->process = h2_deferred_shut; h2s->wait_event.task->context = h2s; - h2s->wait_event.handle = NULL; h2s->wait_event.events = 0; LIST_INIT(&h2s->list); LIST_INIT(&h2s->sending_list); @@ -5188,7 +5187,6 @@ static int h2_subscribe(struct conn_stream *cs, int event_type, void *param) sw = param; if (!(sw->events & SUB_RETRY_RECV)) { sw->events |= SUB_RETRY_RECV; - sw->handle = h2s; h2s->recv_wait = sw; } event_type &= ~SUB_RETRY_RECV; @@ -5197,7 +5195,6 @@ static int h2_subscribe(struct conn_stream *cs, int event_type, void *param) sw = param; if (!(sw->events & SUB_RETRY_SEND)) { sw->events |= SUB_RETRY_SEND; - sw->handle = h2s; h2s->send_wait = sw; if (!(h2s->flags & H2_SF_BLK_SFCTL) && !LIST_ADDED(&h2s->list)) {