diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-25 14:48:16 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-25 14:48:16 +0000 |
commit | 39fe91b9a281a3ec8504bf7933a63918038a9b5a (patch) | |
tree | 010c8fa5a1d6fe4cbd5d35973bb686259b307865 /src/or/config.c | |
parent | e9c294654deeb41a4f80420c3f4ee67cd9ecee70 (diff) | |
download | tor-39fe91b9a281a3ec8504bf7933a63918038a9b5a.tar tor-39fe91b9a281a3ec8504bf7933a63918038a9b5a.tar.gz |
r12946@catbus: nickm | 2007-05-25 10:46:50 -0400
Add an AutomapHostsOnResolve option. It seems to work.
svn:r10324
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8cfd5087f..ab3ec0989 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -67,6 +67,8 @@ static config_abbrev_t _option_abbrevs[] = { PLURAL(StrictExitNode), { "l", "Log", 1, 0}, { "AllowUnverifiedNodes", "AllowInvalidNodes", 0, 0}, + { "AutomapHostSuffixes", "AutomapHostsSuffixes", 0, 0}, + { "AutomapHostOnResolve", "AutomapHostsOnResolve", 0, 0}, { "BandwidthRateBytes", "BandwidthRate", 0, 0}, { "BandwidthBurstBytes", "BandwidthBurst", 0, 0}, { "DirFetchPostPeriod", "StatusFetchPeriod", 0, 0}, @@ -133,6 +135,8 @@ static config_var_t _option_vars[] = { VAR("AuthDirRejectUnlisted",BOOL, AuthDirRejectUnlisted,"0"), VAR("AuthDirListBadExits", BOOL, AuthDirListBadExits, "0"), VAR("AuthoritativeDirectory",BOOL, AuthoritativeDir, "0"), + VAR("AutomapHostsOnResolve",BOOL, AutomapHostsOnResolve,"0"), + VAR("AutomapHostsSuffixes",CSV, AutomapHostsSuffixes, ".onion,.exit"), VAR("AvoidDiskWrites", BOOL, AvoidDiskWrites, "0"), VAR("BandwidthBurst", MEMUNIT, BandwidthBurst, "6 MB"), VAR("BandwidthRate", MEMUNIT, BandwidthRate, "3 MB"), @@ -2909,6 +2913,15 @@ options_validate(or_options_t *old_options, or_options_t *options, if (options->PreferTunneledDirConns && !options->TunnelDirConns) REJECT("Must set TunnelDirConns if PreferTunneledDirConns is set."); + if (options->AutomapHostsSuffixes) { + SMARTLIST_FOREACH(options->AutomapHostsSuffixes, char *, suf, + { + size_t len = strlen(suf); + if (len && suf[len-1] == '.') + suf[len-1] = '\0'; + }); + } + return 0; #undef REJECT #undef COMPLAIN |