MINOR: connections: Introduce an unsubscribe method.
As we don't know how subscriptions are handled, we can't just assume we can
use LIST_DEL() to unsubscribe, so introduce a new method to mux and connections
to do so.
diff --git a/include/types/connection.h b/include/types/connection.h
index 27ae76e..26f9bed 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -301,6 +301,7 @@
int (*get_alpn)(const struct connection *conn, const char **str, int *len); /* get application layer name */
char name[8]; /* transport layer name, zero-terminated */
int (*subscribe)(struct connection *conn, int event_type, void *param); /* Subscribe to events, such as "being able to send" */
+ int (*unsubscribe)(struct connection *conn, int event_type, void *param); /* Unsubscribe to events */
};
/* mux_ops describes the mux operations, which are to be performed at the
@@ -325,6 +326,7 @@
void (*detach)(struct conn_stream *); /* Detach a conn_stream from an outgoing connection, when the request is done */
void (*show_fd)(struct buffer *, struct connection *); /* append some data about connection into chunk for "show fd" */
int (*subscribe)(struct conn_stream *cs, int event_type, void *param); /* Subscribe to events, such as "being able to send" */
+ int (*unsubscribe)(struct conn_stream *cs, int event_type, void *param); /* Unsubscribe to events */
unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */
char name[8]; /* mux layer name, zero-terminated */
};
@@ -338,7 +340,6 @@
*/
struct data_cb {
int (*wake)(struct conn_stream *cs); /* data-layer callback to report activity */
- int (*subscribe)(struct conn_stream *cs, int event_type, void *param); /* Subscribe to events, such as "being able to send" */
char name[8]; /* data layer name, zero-terminated */
};