]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: fd: remove fdtab->flags
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 20:14:47 +0000 (22:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 3 Sep 2012 18:49:14 +0000 (20:49 +0200)
These flags were added for TCP_CORK. They were only set at various places
but never checked by any user since TCP_CORK was replaced with MSG_MORE.
Simply get rid of this now.

include/types/fd.h
src/checks.c
src/frontend.c
src/proto_tcp.c
src/session.c

index c9b50c2e5e77fb3b514cca188c403c02b76b0d1b..f45b04603f3d1a875c83baf28dbf59dbe8b7a55c 100644 (file)
@@ -51,13 +51,6 @@ enum {
 #define FD_POLL_DATA    (FD_POLL_IN  | FD_POLL_OUT)
 #define FD_POLL_STICKY  (FD_POLL_ERR | FD_POLL_HUP)
 
-/* bit values for fdtab[fd]->flags. Most of them are used to hold a value
- * consecutive to a behaviour change.
- */
-#define FD_FL_TCP               0x0001       /* socket is TCP */
-#define FD_FL_TCP_NODELAY       0x0002
-#define FD_FL_TCP_NOLING        0x0004       /* lingering disabled */
-
 /* info about one given fd */
 struct fdtab {
        int (*iocb)(int fd);                 /* I/O handler, returns FD_WAIT_* */
@@ -66,7 +59,6 @@ struct fdtab {
                unsigned char e;             /* read and write events status. 4 bits, may be merged into flags' lower bits */
                unsigned int s1;             /* Position in spec list+1. 0=not in list. */
        } spec;
-       unsigned short flags;                /* various flags precising the exact status of this fd */
        unsigned char ev;                    /* event seen in return of poll() : FD_POLL_* */
 };
 
index 93f93dfc28bf7c56d4ae994a2503da75d98990b6..cb59d5856652ec183c2ee0a5ecbd88734dab29be 100644 (file)
@@ -1476,7 +1476,6 @@ static struct task *process_chk(struct task *t)
                                                fd_insert(fd);
                                                fdtab[fd].owner = t;
                                                fdtab[fd].iocb = &check_iocb;
-                                               fdtab[fd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY;
                                                fd_want_send(fd);  /* for connect status */
 #ifdef DEBUG_FULL
                                                assert (!EV_FD_ISSET(fd, DIR_RD));
index 73802553d21e2f05b17290bf581c9865c4c9cb11..b2b6b1141c792146eceac7fb8c4969fa92191f7e 100644 (file)
@@ -197,10 +197,6 @@ int frontend_accept(struct session *s)
        s->req->rto = s->fe->timeout.client;
        s->rep->wto = s->fe->timeout.client;
 
-       fdtab[cfd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY;
-       if (s->fe->options & PR_O_TCP_NOLING)
-               fdtab[cfd].flags |= FD_FL_TCP_NOLING;
-
        if (unlikely((s->fe->mode == PR_MODE_HTTP && (s->flags & SN_MONITOR)) ||
                     (s->fe->mode == PR_MODE_HEALTH && ((s->fe->options2 & PR_O2_CHK_ANY) == PR_O2_HTTP_CHK)))) {
                /* Either we got a request from a monitoring system on an HTTP instance,
index 99741dc2dc18c99163a280c7a7b292202fb58b27..37731445629f4911764b858334d33c64c80bbc7b 100644 (file)
@@ -452,7 +452,6 @@ int tcp_connect_server(struct connection *conn, int data)
        }
 
        fdtab[fd].owner = conn;
-       fdtab[fd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY;
        conn->flags  = CO_FL_WAIT_L4_CONN; /* connection in progress */
 
        fdtab[fd].iocb = conn_fd_handler;
@@ -694,7 +693,6 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
        listener->state = LI_LISTEN;
 
        fdtab[fd].owner = listener; /* reference the listener instead of a task */
-       fdtab[fd].flags = FD_FL_TCP | ((listener->options & LI_O_NOLINGER) ? FD_FL_TCP_NOLING : 0);
        fdtab[fd].iocb = listener->proto->accept;
        fd_insert(fd);
 
index 7f72156e99a7ab2932e640957bdc6ab224985d8c..c4323da126409de735642458b42ae1801cef9a1e 100644 (file)
@@ -151,7 +151,6 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
        /* finish initialization of the accepted file descriptor */
        fd_insert(cfd);
        fdtab[cfd].owner = &s->si[0].conn;
-       fdtab[cfd].flags = 0;
        fdtab[cfd].iocb = conn_fd_handler;
        conn_data_want_recv(&s->si[0].conn);
        if (conn_data_init(&s->si[0].conn) < 0)