MAJOR: listeners: use dual-linked lists to chain listeners with frontends
Navigating through listeners was very inconvenient and error-prone. Not to
mention that listeners were linked in reverse order and reverted afterwards.
In order to definitely get rid of these issues, we now do the following :
- frontends have a dual-linked list of bind_conf
- frontends have a dual-linked list of listeners
- bind_conf have a dual-linked list of listeners
- listeners have a pointer to their bind_conf
This way we can now navigate from anywhere to anywhere and always find the
proper bind_conf for a given listener, as well as find the list of listeners
for a current bind_conf.
diff --git a/include/types/proxy.h b/include/types/proxy.h
index dde002a..5c078d9 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -200,7 +200,6 @@
};
struct proxy {
- struct listener *listen; /* the listen addresses and sockets */
struct in_addr mon_net, mon_mask; /* don't forward connections from this net (network order) FIXME: should support IPv6 */
int state; /* proxy state */
int options; /* PR_O_REDISP, PR_O_TRANSP, ... */
@@ -361,6 +360,7 @@
struct eb_root used_listener_id;/* list of listener IDs in use */
struct eb_root used_server_id; /* list of server IDs in use */
struct list bind; /* list of bind settings */
+ struct list listeners; /* list of listeners belonging to this frontend */
} conf; /* config information */
void *parent; /* parent of the proxy when applicable */
};