torproject / tor Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dirauth config #1607
Closed
Closed
Dirauth config #1607
Conversation
This change allows other modules to include confdecl.h without having first to include integer types they might not even use.
These modules are only built when the selected modules are disabled. The provide stub implementations of the subsystem blocks. Later, other stub implementations could move here. Having real subsystem blocks here will let us handle disabled configuration options better.
Like "obsolete" variables, these variables produce a warning when you try to set them, but the warning says that the relevant module doesn't have support. The confdecl macros now have a CONF_CONTEXT that you can define to make all the modules in a given table disabled.
When a subsystem is disabled, there will be no corresponding object allocated, and no magic numbers on it.
I've chosen the "AuthDirMaxServersPerAddr" option here for simplicity, since it is used literally nowhere else besides the dirauth module. Once we have all the infrastructure in place for this, we can move more options into this structure.
Pull Request Test Coverage Report for Build 7603
|
teor2345
reviewed
Dec 18, 2019
src/feature/dirauth/.may_include
Outdated
| @@ -1 +1,2 @@ | |||
| *.h | |||
| *.inc | |||
I don't think it needs to include any *.inc outside of feature/dirauth/ ?
Suggested change
| *.inc | |
| feature/dirauth/*.inc |
teor2345
reviewed
Dec 18, 2019
src/feature/dirauth/dirauth_stub.c
Outdated
|
|
||
| static const config_format_t dirauth_options_stub_fmt = { | ||
| .vars = dirauth_options_t_vars, | ||
| }; | ||
|
|
||
| const struct subsys_fns_t sys_dirauth = { | ||
| .name = "dirauth", | ||
| .supported = false, | ||
| .level = 70, |
If we duplicate the level in *_sys and *_stub, they will get out of sync.
Maybe supported modules shouldn't need a level?
Or maybe they should have an otherwise-illegal level number, using a named #define for readability?
teor2345
reviewed
Dec 18, 2019
src/feature/relay/relay_stub.c
Outdated
| const struct subsys_fns_t sys_relay = { | ||
| .name = "relay", | ||
| .supported = false, | ||
| .level = 50, |
Similar to dirauth_stub, the level should not be duplicated.
This way, we can't get out of sync between the two declarations.
Make the .may_include line for *.inc more specific.
|
I think this ticket was squashed and merged? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
No description provided.
The text was updated successfully, but these errors were encountered: