]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: protocol: remove the ->drain() function
authorWilly Tarreau <w@1wt.eu>
Wed, 14 Oct 2020 14:05:00 +0000 (16:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2020 19:47:04 +0000 (21:47 +0200)
No protocol defines it anymore. The last user used to be the monitor-net
stuff that got partially broken already when the tcp_drain() function
moved to conn_sock_drain() with commit e215bba95 ("MINOR: connection:
make conn_sock_drain() work for all socket families") in 1.9-dev2.

A part of this will surely move back later when non-socket connections
arrive with QUIC but better keep the API clean and implement what's
needed in time instead.

include/haproxy/protocol-t.h
src/connection.c

index ae7ec1975974b0e36eed6ed4e6840f05f3420533..f2aa4affe451e54de076e6d17de275f05a141c5c 100644 (file)
@@ -106,7 +106,6 @@ struct protocol {
        /* functions acting on connections */
        void (*accept)(int fd);                         /* generic accept function */
        int (*connect)(struct connection *, int flags); /* connect function if any, see below for flags values */
-       int (*drain)(int fd);                           /* indicates whether we can safely close the fd */
 
        struct list receivers;                          /* list of receivers using this protocol (under proto_lock) */
        int nb_receivers;                               /* number of receivers (under proto_lock) */
index 9c017bcf901a4b0d1927892162430503b1509f0e..1274112d8b0c413db499d8f92c0b0004dbc23dc4 100644 (file)
@@ -420,12 +420,6 @@ int conn_sock_drain(struct connection *conn)
        if (!fd_recv_ready(conn->handle.fd))
                return 0;
 
-       if (conn->ctrl->drain) {
-               if (conn->ctrl->drain(conn->handle.fd) <= 0)
-                       return 0;
-               goto shut;
-       }
-
        /* no drain function defined, use the generic one */
 
        while (turns) {