[MINOR] recompute maxfd before touching fdtab
It may be dangerous to play with fdtab before doing fd_insert()
because this last one is responsible for growing maxfd as needed.
Call fd_insert() before instead.
diff --git a/src/proxy.c b/src/proxy.c
index a5431c2..93eab16 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -147,12 +147,12 @@
listener->fd = fd;
/* the function for the accept() event */
+ fd_insert(fd);
fdtab[fd].cb[DIR_RD].f = &event_accept;
fdtab[fd].cb[DIR_WR].f = NULL; /* never called */
fdtab[fd].cb[DIR_RD].b = fdtab[fd].cb[DIR_WR].b = NULL;
fdtab[fd].owner = (struct task *)curproxy; /* reference the proxy instead of a task */
fdtab[fd].state = FD_STLISTEN;
- fd_insert(fd);
listeners++;
}