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
Ticket32487 #1644
Ticket32487 #1644
Conversation
For now, this module is enabled whenever the relay module is enabled, and disabled whenever the relay module is disabled. Though they are logically separate, the use cases for running one without the other are rare enough that we don't really want to support compiling them independently.
Only directory caches actually need to spool things.
This function had some XXX comments indicating (correctly) that it was not actually used by the dirserver code, and that only the controller still used it.
This is cleaner than iterating over the spool.
To make Tor still work, we define a minimal dircache_stub.c file that defines the entry points to the module that can actually be seen by the compiler when we're building with dircache and relay disabled.
Pull Request Test Coverage Report for Build 7788
|
doc/HACKING/Module.md
Outdated
| being progressively refactored and disabled. | ||
|
|
||
| The dircache code is located in `src/*/*dircache`. Right now, it is | ||
| enabled if and only if the relay module is disabled. (We are treating |
| enabled if and only if the relay module is disabled. (We are treating | |
| disabled if and only if the relay module is disabled. (We are treating |
src/core/mainloop/fooz
Outdated
| @@ -0,0 +1,10 @@ | |||
|
|
|||
This file appears to be a temporary file, that was committed by mistake.
src/feature/dircache/dircache_stub.c
Outdated
| return -1; | ||
| } | ||
|
|
||
| int |
We usually stub out functions like this using macros, because it lets the optimiser eliminate more dead code. This comment applies to all the stub functions that return a value, particularly if they have no side effects.
(The functions with side effects could also become inline functions in the header.)
For example:
https://github.com/torproject/tor/blob/master/src/feature/relay/routermode.h#L28
src/feature/dircache/dircache_stub.c
Outdated
| } | ||
|
|
||
| int | ||
| directory_fetches_dir_info_early(const or_options_t *options) |
FetchDirInfoEarly is listed as a general option in the man page. It does work on clients, and it's used by some custom client setups (like bandwidth scanners, and other directory monitors).
I think it's ok to disable this option when dircache mode is disabled, but we need to document that in the man page. Maybe it should be moved to an "Advanced Options" section, with a note that these options don't work on clients, when compiled with dircache mode disabled?
(This function calls directory_fetches_from_authorities(), which checks the value of FetchDirInfoEarly.)
There are a bunch of related options used by should_use_directory_guards():
- UseEntryGuards
- DownloadExtraInfo
- FetchDirInfoEarly
- FetchDirInfoExtraEarly
- FetchUselessDescriptors
tor/src/feature/dirclient/dirclient.c
Line 310 in 4f02812
/** Return true iff, according to the values in <b>options</b>, we should be
For consistency, we should probably either keep all these options, or disable all of them. If we decide to disable them, let's do it in a separate ticket, and make directory_fetches_dir_info_early() a dircommon function for now?
src/feature/dircache/dircache_stub.c
Outdated
| return 0; | ||
| } | ||
|
|
||
| int |
Despite its name, this is actually a dirclient function, which depends on the value of UseBridges.
src/feature/dircache/dircache_stub.c
Outdated
| } | ||
|
|
||
| int | ||
| directory_too_idle_to_fetch_descriptors(const or_options_t *options, |
Despite its name, this is actually a dirclient function:
- it depends on
rep_hist_circbuilding_dormant(), which is a client function, and - it depends on
FetchUselessDescriptors, which is a general option in the man page, but probably belongs in an "Advanced Options" section, likeFetchDirInfoEarly.
(Unlike FetchDirInfoEarly, disabling the dircache module doesn't actually disable FetchUselessDescriptors, but I wouldn't mind if it did.)
But if we decide to disable FetchUselessDescriptors when dircache is disabled, let's do it in a separate ticket.
| @@ -289,6 +289,14 @@ AM_COND_IF(BUILD_MODULE_RELAY, | |||
| AC_DEFINE([HAVE_MODULE_RELAY], [1], | |||
| [Compile with Relay feature support])) | |||
|
|
|||
| dnl Dircache module. (This cannot be enabled or disabled independently of | |||
Please add a note that this module isn't listed in --list-modules.
We also don't have a have_module_dircache() function. I don't mind either way, but we should either have the function, or have a comment in dircache.h explaining why it doesn't exist.
We don't check for dircache in list_enabled_modules(). That's actually a good thing, because if we did, we'd have to make a large number of changes to the test cases in test_parseconf.sh. Let's add comments in list_enabled_modules() and test_parseconf.sh explaining why the dircache module isn't listed.
If you do want to list the dircache module, please make test_parseconf.sh ignore the dircache module, so we don't have to modify a whole bunch of tests. (By adding dircache_ to the relay_ disabled module file names.)
Remove an accidentally committed temporary file.
s/enabled/disabled/
I had incorrectly identified these functions as dircache-only, when in fact they apply to everyone who acts a directory client.
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
directory_must_use_begindir dirclient_must_use_begindir \
directory_fetches_from_authorities dirclient_fetches_from_authorities \
directory_fetches_dir_info_early dirclient_fetches_dir_info_early \
directory_fetches_dir_info_later dirclient_fetches_dir_info_later \
directory_too_idle_to_fetch_descriptors dirclient_too_idle_to_fetch_descriptors
This may help the compiler eliminate deadcode.
src/app/config/config.c
Outdated
| @@ -2733,6 +2733,9 @@ list_enabled_modules(void) | |||
| { | |||
| printf("%s: %s\n", "relay", have_module_relay() ? "yes" : "no"); | |||
| printf("%s: %s\n", "dirauth", have_module_dirauth() ? "yes" : "no"); | |||
| // We don't list dircache, because it cannot be enabled or disabled | |||
| // independently from relay. Listing it here would proliferate | |||
| // tests in test_parseconf.c to no useful purpose. | |||
It's actually the parseconf script, not the unit tests :-)
| // tests in test_parseconf.c to no useful purpose. | |
| // test variants in test_parseconf.sh to no useful purpose. |
refer to the correct tests
Fix compilation errors.
No description provided.
The text was updated successfully, but these errors were encountered: