MINOR: fd: Set owner and iocb field before inserting a new fd in the fdtab
This will be needed for concurrent accesses.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 9be862b..2ec2ef8 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -108,12 +108,12 @@
if (!conn_ctrl_ready(conn)) {
int fd = conn->handle.fd;
+ fdtab[fd].owner = conn;
+ fdtab[fd].iocb = conn_fd_handler;
fd_insert(fd);
/* mark the fd as ready so as not to needlessly poll at the beginning */
fd_may_recv(fd);
fd_may_send(fd);
- fdtab[fd].owner = conn;
- fdtab[fd].iocb = conn_fd_handler;
conn->flags |= CO_FL_CTRL_READY;
}
}