mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: raw_sock: Add a close method.
Add a close() method, that explicitely cancels any subscription on the connection, in preparation for future evolutions.
This commit is contained in:
parent
ed4bef76bd
commit
ca1a57f022
@ -434,6 +434,13 @@ static int raw_sock_unsubscribe(struct connection *conn, void *xprt_ctx, int eve
|
|||||||
return conn_unsubscribe(conn, xprt_ctx, event_type, es);
|
return conn_unsubscribe(conn, xprt_ctx, event_type, es);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void raw_sock_close(struct connection *conn, void *xprt_ctx)
|
||||||
|
{
|
||||||
|
if (conn->subs != NULL) {
|
||||||
|
conn_unsubscribe(conn, NULL, conn->subs->events, conn->subs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* We can't have an underlying XPRT, so just return -1 to signify failure */
|
/* We can't have an underlying XPRT, so just return -1 to signify failure */
|
||||||
static int raw_sock_remove_xprt(struct connection *conn, void *xprt_ctx, void *toremove_ctx, const struct xprt_ops *newops, void *newctx)
|
static int raw_sock_remove_xprt(struct connection *conn, void *xprt_ctx, void *toremove_ctx, const struct xprt_ops *newops, void *newctx)
|
||||||
{
|
{
|
||||||
@ -457,7 +464,7 @@ static struct xprt_ops raw_sock = {
|
|||||||
#endif
|
#endif
|
||||||
.shutr = NULL,
|
.shutr = NULL,
|
||||||
.shutw = NULL,
|
.shutw = NULL,
|
||||||
.close = NULL,
|
.close = raw_sock_close,
|
||||||
.name = "RAW",
|
.name = "RAW",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user