]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: appctx/cli: remove the cli_socket entry from the appctx union
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 11:58:09 +0000 (12:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 18:40:13 +0000 (19:40 +0100)
This one now migrates to the general purpose cli.p0.

include/types/applet.h
src/cli.c

index 672f9db28f815a75885258e14379487574a3bf3c..62537a8265c81b8a0804157e6bf94f530e1a5e73 100644 (file)
@@ -168,7 +168,6 @@ struct appctx {
                struct {
                        char **var;
                } env;
-               struct list *cli_socket;        /* pointer to the latest dumped CLI socket in the list */
                /* NOTE: please add regular applet contexts (ie: not
                 * CLI-specific ones) above, before "cli".
                 */
index adb2dd6047e7e634b4de83963237cd6199278d90..c84d72f4b1a21efc8b501675f3a63d7308cff28a 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -729,7 +729,8 @@ static int cli_io_handler_show_env(struct appctx *appctx)
 }
 
 /*
- * CLI IO handler for `show cli sockets`
+ * CLI IO handler for `show cli sockets`.
+ * Uses ctx.cli.p0 to store the restart pointer.
  */
 static int cli_io_handler_show_cli_sock(struct appctx *appctx)
 {
@@ -745,7 +746,6 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                                si_applet_cant_put(si);
                                return 0;
                        }
-                       appctx->ctx.cli_socket = NULL;
                        appctx->st2 = STAT_ST_LIST;
 
                case STAT_ST_LIST:
@@ -754,15 +754,14 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                                        struct listener *l;
 
                                        /*
-                                        * get the latest dumped node in appctx->ctx.cli_socket
+                                        * get the latest dumped node in appctx->ctx.cli.p0
                                         * if the current node is the first of the list
                                         */
 
-                                       if (appctx->ctx.cli_socket  &&
-                                           &bind_conf->by_fe == (&global.stats_fe->conf.bind)->n
-                                          ) {
+                                       if (appctx->ctx.cli.p0  &&
+                                           &bind_conf->by_fe == (&global.stats_fe->conf.bind)->n) {
                                                /* change the current node to the latest dumped and continue the loop */
-                                               bind_conf = LIST_ELEM(appctx->ctx.cli_socket, typeof(bind_conf), by_fe);
+                                               bind_conf = LIST_ELEM(appctx->ctx.cli.p0, typeof(bind_conf), by_fe);
                                                continue;
                                        }
 
@@ -815,7 +814,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
                                                        return 0;
                                                }
                                        }
-                                       appctx->ctx.cli_socket = &bind_conf->by_fe; /* store the latest list node dumped */
+                                       appctx->ctx.cli.p0 = &bind_conf->by_fe; /* store the latest list node dumped */
                                }
                        }
                default: