Age | Commit message (Collapse) | Author |
|
This commit only does code movement, and does not clean up after
itself. As such, it will break compilation. I'm separating it for
ease of review.
|
|
See also ticket 31654.
|
|
Here we make it clear we're only looking at listable variable names,
not at whether the variables themselves are gettable.
Also, remove an extraneous h.
(This commit is not a fixup, because of rebase conflicts.)
|
|
The old names remain as #defines that cause variables to get one or
more flags.
Now every flag-testing function in confparse.c tests exactly one flag.
|
|
Since the flags are now stored with compatible numbering, we can
just OR them together and see whether the flag we want is in the
result.
(Net code removal!)
|
|
|
|
Don't use "derived" directly, but check its implications for listing
and copying.
|
|
We had though to make all obsolete and invisible variables
ungettable, so that GETCONF would reject them. But it turns out
that this isn't the current behavior of GETCONF with those
variables. So for now, I'm leaving the current behavior unchanged.
(See ticket 31647 for a proposal to change the behavior.)
|
|
|
|
|
|
This change replaces the higher-level property check to match our
intended flag factoring.
|
|
|
|
|
|
|
|
|
|
When we parse a CLEAR line (e.g., "/OrPort" or /OrPort blah blah"),
we always suppress the value, even if one exists. That means that
the block of code was meant to handle CLEAR lines didn't actually do
anything, since we previously handled them the same way as with
other empty values.
Closes ticket 31529.
|
|
|
|
|
|
One test makes sure that the toplevel magic numbers are distinct.
One test makes sure that we can parse a configuration object
with two sub-objects.
|
|
Fix a bug in config_find_option_name() where it did not consider
the abbreviations table.
|
|
This discovered a bug related to an extra & in
config_mgr_list_deprecated_vars(): fix that.
|
|
|
|
|
|
|
|
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.
|
|
Right now, it doesn't do anything; this patch is meant to make sure
that we're doing memory management correctly.
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
We'll want it to check all the subsidiary structures of the
options object.
|
|
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.
|
|
|
|
|
|
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.
|
|
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".
|
|
Previously, these were magical things that we detected by checking
whether a variable's name was prefixed with two or three underscores.
|
|
"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.
|
|
|
|
|
|
|
|
This requires changes to config_var_t, causing corresponding changes
throughout its users.
|
|
|
|
Right now, this has been done at a high level by confparse.c, but it
makes more sense to lower it.
This API is radically un-typesafe as it stands; we'll be wrapping it
in a safer API as we do #30914 and lower the struct manipulation
code as well.
Closes ticket 30864.
|
|
lib/confmgt is at a higher level than lib/conf, since it needs to
call down to logging and similar modules.
|
|
|