]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn_streams: Remove wait_list from conn_streams.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 12 Sep 2018 13:21:03 +0000 (15:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 15:37:55 +0000 (17:37 +0200)
The conn_streams won't be used for subscribing/waiting for I/O events, after
all, so just remove its wait_list, and send/recv/_wait_list.

include/proto/connection.h
include/types/connection.h
src/stream_interface.c

index c7f25613c7a951b32d48b72a576e905645fd9c09..2a45677b706679095dd123a5694f44273f94b8ca 100644 (file)
@@ -600,12 +600,7 @@ static inline void cs_init(struct conn_stream *cs, struct connection *conn)
 {
        cs->obj_type = OBJ_TYPE_CS;
        cs->flags = CS_FL_NONE;
-       LIST_INIT(&cs->wait_list.list);
-       LIST_INIT(&cs->send_wait_list);
-       LIST_INIT(&cs->recv_wait_list);
-       LIST_INIT(&cs->sendrecv_wait_list);
        cs->conn = conn;
-       cs->wait_list.wait_reason = 0;
 }
 
 /* Initializes all required fields for a new connection. Note that it does the
@@ -673,8 +668,6 @@ static inline struct connection *conn_new()
  */
 static inline void cs_free(struct conn_stream *cs)
 {
-       if (cs->wait_list.task)
-               tasklet_free(cs->wait_list.task);
 
        pool_free(pool_head_connstream, cs);
 }
@@ -694,11 +687,6 @@ static inline struct conn_stream *cs_new(struct connection *conn)
        if (!likely(cs))
                return NULL;
 
-       cs->wait_list.task = tasklet_new();
-       if (!likely(cs->wait_list.task)) {
-               cs_free(cs);
-               return NULL;
-       }
        if (!conn) {
                conn = conn_new();
                if (!likely(conn)) {
index 998ecacb0e54beeb42795e6bbae251a18e004bff..59bb27d1ba1bd4d310b7cb46e34f0cefd2ca2dcc 100644 (file)
@@ -372,10 +372,6 @@ struct conn_stream {
        /* 3 bytes hole here */
        unsigned int flags;                  /* CS_FL_* */
        struct connection *conn;             /* xprt-level connection */
-       struct wait_list wait_list;          /* We're in a wait list for send */
-       struct list send_wait_list;          /* list of tasks to wake when we're ready to send */
-       struct list recv_wait_list;          /* list of tasks to wake when we're ready to recv */
-       struct list sendrecv_wait_list;      /* list of tasks to wake when we're ready to either send or recv */
        void *data;                          /* pointer to upper layer's entity (eg: stream interface) */
        const struct data_cb *data_cb;       /* data layer callbacks. Must be set before xprt->init() */
        void *ctx;                           /* mux-specific context */
index 13f7aa309299e4f5b2057dff7c2d8717c08c5af7..eb04043e4b00ed8644cc04f515c7d39df82972b4 100644 (file)
@@ -671,7 +671,7 @@ static int si_cs_send(struct conn_stream *cs)
         * in the normal buffer.
         */
        if (!co_data(oc))
-               goto wake_others;
+               return did_send;
 
        /* when we're here, we already know that there is no spliced
         * data left, and that there are sendable buffered data.
@@ -723,29 +723,6 @@ static int si_cs_send(struct conn_stream *cs)
                cs_want_send(cs);
                conn->mux->subscribe(cs, SUB_CAN_SEND, &si->wait_list);
        }
-
-wake_others:
-       /* Maybe somebody was waiting for this conn_stream, wake them */
-       if (did_send) {
-               while (!LIST_ISEMPTY(&cs->send_wait_list)) {
-                       struct wait_list *sw = LIST_ELEM(cs->send_wait_list.n,
-                           struct wait_list *, list);
-                       LIST_DEL(&sw->list);
-                       LIST_INIT(&sw->list);
-                       sw->wait_reason &= ~SUB_CAN_SEND;
-                       tasklet_wakeup(sw->task);
-               }
-               while (!(LIST_ISEMPTY(&cs->sendrecv_wait_list))) {
-                       struct wait_list *sw = LIST_ELEM(cs->sendrecv_wait_list.n,
-                           struct wait_list *, list);
-                       LIST_DEL(&sw->list);
-                       LIST_INIT(&sw->list);
-                       LIST_ADDQ(&cs->recv_wait_list, &sw->list);
-                       sw->wait_reason &= ~SUB_CAN_SEND;
-                       tasklet_wakeup(sw->task);
-               }
-
-       }
        return did_send;
 }
 
@@ -1357,26 +1334,6 @@ static int si_cs_recv(struct conn_stream *cs)
                }
                ic->last_read = now_ms;
        }
-       if (cur_read > 0) {
-               while (!LIST_ISEMPTY(&cs->recv_wait_list)) {
-                       struct wait_list *sw = LIST_ELEM(cs->recv_wait_list.n,
-                           struct wait_list *, list);
-                       LIST_DEL(&sw->list);
-                       LIST_INIT(&sw->list);
-                       sw->wait_reason &= ~SUB_CAN_RECV;
-                       tasklet_wakeup(sw->task);
-               }
-               while (!(LIST_ISEMPTY(&cs->sendrecv_wait_list))) {
-                       struct wait_list *sw = LIST_ELEM(cs->sendrecv_wait_list.n,
-                           struct wait_list *, list);
-                       LIST_DEL(&sw->list);
-                       LIST_INIT(&sw->list);
-                       LIST_ADDQ(&cs->send_wait_list, &sw->list);
-                       sw->wait_reason &= ~SUB_CAN_RECV;
-                       tasklet_wakeup(sw->task);
-               }
-
-       }
 
  end_recv:
        if (conn->flags & CO_FL_ERROR || cs->flags & CS_FL_ERROR)