mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-11 22:15:14 +00:00
MINOR: Add release callback to si_applet
This commit is contained in:
parent
19979e176e
commit
9a13e84cc2
@ -189,6 +189,7 @@ struct stream_interface {
|
||||
struct si_applet {
|
||||
char *name; /* applet's name to report in logs */
|
||||
void (*fct)(struct stream_interface *); /* internal I/O handler, may never be NULL */
|
||||
void (*release)(struct stream_interface *); /* callback to release resources, may be NULL */
|
||||
};
|
||||
|
||||
#endif /* _TYPES_STREAM_INTERFACE_H */
|
||||
|
@ -3961,11 +3961,13 @@ static int stats_dump_errors_to_buffer(struct stream_interface *si)
|
||||
struct si_applet http_stats_applet = {
|
||||
.name = "<STATS>", /* used for logging */
|
||||
.fct = http_stats_io_handler,
|
||||
.release = NULL,
|
||||
};
|
||||
|
||||
static struct si_applet cli_applet = {
|
||||
.name = "<CLI>", /* used for logging */
|
||||
.fct = cli_io_handler,
|
||||
.release = NULL,
|
||||
};
|
||||
|
||||
static struct cfg_kw_list cfg_kws = {{ },{
|
||||
|
@ -1044,6 +1044,7 @@ quit:
|
||||
static struct si_applet peer_applet = {
|
||||
.name = "<PEER>", /* used for logging */
|
||||
.fct = peer_io_handler,
|
||||
.release = peer_session_release,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1079,7 +1080,6 @@ int peer_accept(struct session *s)
|
||||
/* we have a dedicated I/O handler for the stats */
|
||||
stream_int_register_handler(&s->si[1], &peer_applet);
|
||||
copy_target(&s->target, &s->si[1].target); // for logging only
|
||||
s->si[1].release = peer_session_release;
|
||||
s->si[1].applet.private = s;
|
||||
s->si[1].applet.st0 = PEER_SESSION_ACCEPT;
|
||||
|
||||
@ -1165,7 +1165,6 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
|
||||
s->si[0].applet.st0 = PEER_SESSION_CONNECT;
|
||||
|
||||
stream_int_register_handler(&s->si[0], &peer_applet);
|
||||
s->si[0].release = peer_session_release;
|
||||
|
||||
s->si[1].fd = -1; /* just to help with debugging */
|
||||
s->si[1].owner = t;
|
||||
|
@ -316,7 +316,7 @@ struct task *stream_int_register_handler(struct stream_interface *si, struct si_
|
||||
si->connect = NULL;
|
||||
set_target_applet(&si->target, app);
|
||||
si->applet.state = 0;
|
||||
si->release = NULL;
|
||||
si->release = app->release;
|
||||
si->flags |= SI_FL_WAIT_DATA;
|
||||
return si->owner;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user