MEDIUM: applet: Set the conn-stream as appctx owner instead of the stream-int
Because appctx is now an endpoint of the conn-stream, there is no reason to
still have the stream-interface as appctx owner. Thus, the conn-stream is
now the appctx owner.
diff --git a/src/cli.c b/src/cli.c
index c889112..b3a5fff 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -669,7 +669,7 @@
{
if (appctx->cli_severity_output)
return appctx->cli_severity_output;
- return strm_li(si_strm(appctx->owner))->bind_conf->severity_output;
+ return strm_li(si_strm(cs_si(appctx->owner)))->bind_conf->severity_output;
}
/* Processes the CLI interpreter on the stats socket. This function is called
@@ -837,7 +837,7 @@
*/
static void cli_io_handler(struct appctx *appctx)
{
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
struct channel *req = si_oc(si);
struct channel *res = si_ic(si);
struct bind_conf *bind_conf = strm_li(si_strm(si))->bind_conf;
@@ -1160,7 +1160,7 @@
*/
static int cli_io_handler_show_env(struct appctx *appctx)
{
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
char **var = appctx->ctx.cli.p0;
if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@@ -1195,7 +1195,7 @@
*/
static int cli_io_handler_show_fd(struct appctx *appctx)
{
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
int fd = appctx->ctx.cli.i0;
int ret = 1;
@@ -1394,7 +1394,7 @@
*/
static int cli_io_handler_show_activity(struct appctx *appctx)
{
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
int thr;
if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@@ -1497,7 +1497,7 @@
static int cli_io_handler_show_cli_sock(struct appctx *appctx)
{
struct bind_conf *bind_conf;
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
chunk_reset(&trash);
@@ -1634,7 +1634,7 @@
/* parse a "set timeout" CLI request. It always returns 1. */
static int cli_parse_set_timeout(char **args, char *payload, struct appctx *appctx, void *private)
{
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
struct stream *s = si_strm(si);
if (strcmp(args[2], "cli") == 0) {
@@ -1918,7 +1918,7 @@
char *cmsgbuf = NULL;
unsigned char *tmpbuf = NULL;
struct cmsghdr *cmsg;
- struct stream_interface *si = appctx->owner;
+ struct stream_interface *si = cs_si(appctx->owner);
struct stream *s = si_strm(si);
struct connection *remote = cs_conn(si_opposite(si)->cs);
struct msghdr msghdr;