- Aug 28, 2019
-
-
Nick Mathewson authored
This test case, at this point, only constructs the confmgr object. More code to come.
-
Nick Mathewson authored
Fix a bug in config_find_option_name() where it did not consider the abbreviations table.
-
Nick Mathewson authored
This discovered a bug related to an extra & in config_mgr_list_deprecated_vars(): fix that.
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
A configuration manager, in addition to a top-level format object, may now also know about a suite of sub-formats. Top-level configuration objects, in turn, may now have a suite of sub-objects.
-
Nick Mathewson authored
Right now, it doesn't do anything; this patch is meant to make sure that we're doing memory management correctly.
-
Nick Mathewson authored
The right way to free a config object is now to wrap config_free(), always. Instead of creating an alternative free function, objects should provide an alternative clear callback to free any fields that the configuration manager doesn't manage. This lets us simplify our code a little, and lets us extend the confparse.c code to manage additional fields in config_free.
-
Nick Mathewson authored
Every time we finalize a config manager, we now generate a new magic number for it, so that we'll get an assertion failure if we ever try to use an object with a different configuration manager than the one that generated it.
-
- Jul 24, 2019
-
-
Nick Mathewson authored
We'll need to do it this way once the objects become more complex.
-
Nick Mathewson authored
-
Nick Mathewson authored
It's important to make sure that we don't change a config_mgr_t after we start using it to make objects, or we could get into inconsistent states. This feature is the start of a safety mechanism to prevent this problem.
-
Nick Mathewson authored
We'll want it to check all the subsidiary structures of the options object.
-
Nick Mathewson authored
Iterating over this array was once a good idea, but now that we are going to have a separate structure for each submodule's configuration variables, we should indirect through the config_mgr_t object.
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
The eventual design here will be that multiple config_format_t objects get registered with a single config_mgr_t. That config_mgr_t manages a "top-level" object, which has a pointer to the other objects. I had earlier thought of a different design, where there would be no top-level object, and config_mgr_t would deal with a container instead. But this would require a bunch of invasive refactoring that I don't think we should do just yet.
-
Nick Mathewson authored
Remember that our goal in the present refactoring is to allow each subsystem to declare its own configuration structure and variables. To do this, each module will get its own config_format_t, and so we'll want a different structure that wraps several config_format_t objects. This is a "config_mgr_t".
-
Nick Mathewson authored
This C file will eventually belong in lib/confmgt, so it needs to have only low-level dependencies. Now that it no longers needs routerset.c, we can adjust its includes accordingly. I'm not moving the file yet, since it would make fixup commits on earlier branches here really hard to do.
-
Nick Mathewson authored
Now that we have a reasonable implementation for overriding the default options for TestingTorNetwork, we don't need to modify config_var_t structs any more. And therefore, we can have constant format options, like reasonable people.
-
Nick Mathewson authored
Previously, when TestingTorNetwork was set, we would manually adjust the initvalue members of a bunch of other config_var_t, and then re-run the early parts or parsing the options. Now we treat the initvalue fields as immutable, but instead assign to them in options_init(), as early as possible. Rather than re-running the early parts of options, we just re-call the options_init_from_string() function. This patch de-kludges some of our code pretty handily. I think it could later handle authorities and fallbacks, but for now I think we should leave those alone.
-
- Jun 25, 2019
-
-
Nick Mathewson authored
Previously, these were magical things that we detected by checking whether a variable's name was prefixed with two or three underscores.
-
Nick Mathewson authored
"unsettable" is a property of types. LINELIST_V and OBSOLETE are unsettable, meaning that they cannot be set by name. "contained" is a property of types. I'm hoping to find a better name here. LINELIST_S is "contained" because it always appears within a LINELIST_V, and as such doesn't need to be dumped ore copied independently. "cumulative" is a property of types. Cumulative types can appear more than once in a torrc without causing a warning, because they add to each other rather than replacing each other. "obsolete" is a property of variables. "marking fragile" is now a command that struct members can accept. With these changes, confparse and config no longer ever need to mention CONFIG_TYPE_XYZ values by name.
-
Nick Mathewson authored
-
Nick Mathewson authored
Additionally, adjust the macros so that we can add new members like this more easily.
-
Nick Mathewson authored
The testing-only parts now live in a conftesting.h; the shared parts of the macros live in confmacros.h
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
This requires changes to config_var_t, causing corresponding changes throughout its users.
-
Nick Mathewson authored
These functions exist one level higher than typed_var_t. They describe a type, a name, and an offset within a structure.
-