]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG/MEDIUM: fd: get rid of FD_STLISTEN
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Jul 2012 21:36:42 +0000 (23:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:51:25 +0000 (21:51 +0200)
This state was only used so that ev_sepoll did not match FD_STERROR, which
changed in previous patch. We can now safely remove this state.

include/types/fd.h
src/proto_tcp.c
src/proto_uxst.c

index c75734512bdd604a54bdede24cae8f816dab82d2..5d5c5ed8ee799cc0f4a8797eab74df1418ea9643 100644 (file)
@@ -32,7 +32,6 @@
 #include <types/protocols.h>
 
 /* different possible states for the fd */
-#define FD_STLISTEN    1
 #define FD_STCONN      2
 #define FD_STREADY     3
 #define FD_STERROR     4
index 1d38b3caa610299734aee7deb5f234e1189bf855..7da152a0d60a0e6a4de4bacd8a158bfb7f08823f 100644 (file)
@@ -818,7 +818,7 @@ 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].state = FD_STLISTEN;
+       fdtab[fd].state = 0; /* anything will do, but avoid FD_STERROR */
        fdtab[fd].flags = FD_FL_TCP | ((listener->options & LI_O_NOLINGER) ? FD_FL_TCP_NOLING : 0);
        fdtab[fd].cb[DIR_RD].f = listener->proto->accept;
        fdtab[fd].cb[DIR_WR].f = NULL; /* never called */
index 2b4c4de5e04a44319345d4cd171d22ae6988e253..35e48fd0664ae39d2c715f363154dac29bd70a9f 100644 (file)
@@ -265,7 +265,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
        fdtab[fd].cb[DIR_RD].f = listener->proto->accept;
        fdtab[fd].cb[DIR_WR].f = NULL; /* never called */
        fdtab[fd].owner = listener; /* reference the listener instead of a task */
-       fdtab[fd].state = FD_STLISTEN;
+       fdtab[fd].state = 0; /* anything will do, but avoid FD_STERROR */
        return ERR_NONE;
  err_rename:
        ret = rename(backname, path);