[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Merge branch 'ticket31240v2' into ticket31240v2_merged_2



commit b1d7ddfb02cdbd23fce0c30d6ab4897ede18e7fe
Merge: 35e978da6 a3e99c5f1
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Aug 28 09:46:59 2019 -0400

    Merge branch 'ticket31240v2' into ticket31240v2_merged_2

 src/app/config/config.c                   | 157 +++----
 src/app/config/config.h                   |   5 +-
 src/app/config/confparse.c                | 746 +++++++++++++++++++++++-------
 src/app/config/confparse.h                |  83 ++--
 src/app/config/or_options_st.h            |   9 +
 src/app/config/or_state_st.h              |   9 +
 src/app/config/statefile.c                |  43 +-
 src/feature/dirauth/shared_random_state.c |  43 +-
 src/test/fuzz/fuzzing_common.c            |   5 +-
 src/test/include.am                       |   1 +
 src/test/test.c                           |   1 +
 src/test/test.h                           |   1 +
 src/test/test_config.c                    |  92 ++--
 src/test/test_confmgr.c                   | 325 +++++++++++++
 src/test/test_confparse.c                 | 381 ++++++++++-----
 src/test/test_dir_handle_get.c            |   3 +-
 src/test/test_entrynodes.c                |  30 +-
 src/test/test_helpers.c                   |   2 +-
 src/test/test_hs_service.c                |  10 +-
 src/test/test_options.c                   |  14 +-
 src/test/test_pt.c                        |   2 +-
 21 files changed, 1474 insertions(+), 488 deletions(-)

diff --cc src/app/config/config.c
index 740315f3e,66047aeab..0cbc223d0
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@@ -8133,11 -8125,10 +8125,10 @@@ getinfo_helper_config(control_connectio
    (void) errmsg;
    if (!strcmp(question, "config/names")) {
      smartlist_t *sl = smartlist_new();
-     int i;
-     for (i = 0; option_vars_[i].member.name; ++i) {
-       const config_var_t *var = &option_vars_[i];
+     smartlist_t *vars = config_mgr_list_vars(get_options_mgr());
+     SMARTLIST_FOREACH_BEGIN(vars, const config_var_t *, var) {
 -      /* don't tell controller about triple-underscore options */
 -      if (var->flags & CVFLAG_INVISIBLE)
 +      /* don't tell controller about invisible options */
 +      if (config_var_is_invisible(var))
          continue;
        const char *type = struct_var_get_typename(&var->member);
        if (!type)
diff --cc src/app/config/confparse.c
index 6e2624466,e0615ac13..f20a361ba
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@@ -651,13 -1073,13 +1083,13 @@@ config_dump(const config_mgr_t *mgr, co
        continue;
      }
      /* Don't save 'hidden' control variables. */
-     if (! config_var_is_dumpable(&fmt->vars[i]))
 -    if (mv->cvar->flags & CVFLAG_NODUMP)
++    if (! config_var_is_dumpable(mv->cvar))
        continue;
-     if (minimal && config_is_same(fmt, options, defaults,
-                                   fmt->vars[i].member.name))
+     const char *name = mv->cvar->member.name;
+     if (minimal && config_is_same(mgr, options, defaults, name))
        continue;
      else if (comment_defaults &&
-              config_is_same(fmt, options, defaults, fmt->vars[i].member.name))
+              config_is_same(mgr, options, defaults, name))
        comment_option = 1;
  
      line = assigned =



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits