From 40ff59d82097edbfc400e3243b8287c118ab5d10 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 2 Sep 2012 22:14:47 +0200 Subject: [PATCH] CLEANUP: fd: remove fdtab->flags 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 | 8 -------- src/checks.c | 1 - src/frontend.c | 4 ---- src/proto_tcp.c | 2 -- src/session.c | 1 - 5 files changed, 16 deletions(-) diff --git a/include/types/fd.h b/include/types/fd.h index c9b50c2e5..f45b04603 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -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_* */ }; diff --git a/src/checks.c b/src/checks.c index 93f93dfc2..cb59d5856 100644 --- a/src/checks.c +++ b/src/checks.c @@ -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)); diff --git a/src/frontend.c b/src/frontend.c index 73802553d..b2b6b1141 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -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, diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 99741dc2d..377314456 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -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); diff --git a/src/session.c b/src/session.c index 7f72156e9..c4323da12 100644 --- a/src/session.c +++ b/src/session.c @@ -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)