mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-31 02:22:07 +00:00
MINOR: stream_interface: add a data channel close function
This function will be called later when splitting the shutdown in two steps. It will be needed by SSL and for remote socket operations to release unused contexts.
This commit is contained in:
parent
949811319b
commit
24208275d5
@ -189,6 +189,13 @@ static inline int si_connect(struct stream_interface *si)
|
||||
return si_ctrl(si)->connect(si);
|
||||
}
|
||||
|
||||
/* Calls the close() function of the data layer if any */
|
||||
static inline void si_data_close(struct stream_interface *si)
|
||||
{
|
||||
if (si->conn.data->close)
|
||||
si->conn.data->close(&si->conn);
|
||||
}
|
||||
|
||||
#endif /* _PROTO_STREAM_INTERFACE_H */
|
||||
|
||||
/*
|
||||
|
@ -132,7 +132,9 @@ struct sock_ops {
|
||||
void (*chk_rcv)(struct stream_interface *); /* chk_rcv function */
|
||||
void (*chk_snd)(struct stream_interface *); /* chk_snd function */
|
||||
int (*read)(int fd); /* read callback after poll() */
|
||||
int (*write)(int fd); /* wrtie callback after poll() */
|
||||
int (*write)(int fd); /* write callback after poll() */
|
||||
void (*close)(struct connection *); /* close the data channel on the connection */
|
||||
|
||||
};
|
||||
|
||||
/* A stream interface has 3 parts :
|
||||
|
@ -1088,6 +1088,7 @@ struct sock_ops sock_raw = {
|
||||
.chk_snd = sock_raw_chk_snd,
|
||||
.read = sock_raw_read,
|
||||
.write = sock_raw_write,
|
||||
.close = NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -49,6 +49,7 @@ struct sock_ops stream_int_embedded = {
|
||||
.chk_snd = stream_int_chk_snd,
|
||||
.read = NULL,
|
||||
.write = NULL,
|
||||
.close = NULL,
|
||||
};
|
||||
|
||||
/* socket operations for external tasks */
|
||||
@ -60,6 +61,7 @@ struct sock_ops stream_int_task = {
|
||||
.chk_snd = stream_int_chk_snd,
|
||||
.read = NULL,
|
||||
.write = NULL,
|
||||
.close = NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user