aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-29 19:10:42 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-29 19:10:42 +0000
commite136f00ca8a955afc7507ba5e5e91374a7b59401 (patch)
treef9257731321678361d6073bb387b260e7886767a /src/or/config.c
parent6ad71ec37fd8e442f0abd9e6ca055e563878688a (diff)
downloadtor-e136f00ca8a955afc7507ba5e5e91374a7b59401.tar.gz
tor-e136f00ca8a955afc7507ba5e5e91374a7b59401.zip
r16262@catbus: nickm | 2007-10-29 13:21:35 -0400
Patch from Karsten: Code to act as (and use) v2 hidden service directories. svn:r12272
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 6f66ce258b..acb5dc71e2 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -188,6 +188,7 @@ static config_var_t _option_vars[] = {
V(Group, STRING, NULL),
V(HardwareAccel, BOOL, "0"),
V(HashedControlPassword, STRING, NULL),
+ V(HidServDirectoryV2, BOOL, "0"),
VAR("HiddenServiceDir", LINELIST_S, RendConfigLines, NULL),
VAR("HiddenServiceExcludeNodes", LINELIST_S, RendConfigLines, NULL),
VAR("HiddenServiceNodes", LINELIST_S, RendConfigLines, NULL),
@@ -286,8 +287,12 @@ static config_var_t _option_vars[] = {
VAR("VersioningAuthoritativeDirectory",BOOL,VersioningAuthoritativeDir, "0"),
V(VirtualAddrNetwork, STRING, "127.192.0.0/10"),
VAR("__AllDirActionsPrivate", BOOL, AllDirActionsPrivate, "0"),
+ VAR("__ConsiderAllRoutersAsHidServDirectories", BOOL,
+ __ConsiderAllRoutersAsHidServDirectories, "0"),
VAR("__DisablePredictedCircuits",BOOL,DisablePredictedCircuits, "0"),
VAR("__LeaveStreamsUnattached",BOOL, LeaveStreamsUnattached, "0"),
+ VAR("__MinUptimeHidServDirectoryV2", INTERVAL,
+ __MinUptimeHidServDirectoryV2, "24 hours"),
{ NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
};
@@ -2688,6 +2693,9 @@ options_validate(or_options_t *old_options, or_options_t *options,
REJECT("HSAuthorityRecordStats is set but we're not running as "
"a hidden service authority.");
+ if (options->HidServDirectoryV2 && !options->DirPort)
+ REJECT("Running as hidden service directory, but no DirPort set.");
+
if (options->ConnLimit <= 0) {
r = tor_snprintf(buf, sizeof(buf),
"ConnLimit must be greater than 0, but was set to %d",
@@ -2820,6 +2828,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
return -1;
}
+ if (options->__MinUptimeHidServDirectoryV2 < 0) {
+ log_warn(LD_CONFIG, "__MinUptimeHidServDirectoryV2 option must be at "
+ "least 0 seconds. Changing to 0.");
+ options->__MinUptimeHidServDirectoryV2 = 0;
+ }
+
if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
log(LOG_WARN,LD_CONFIG,"RendPostPeriod option must be at least %d seconds."
" Clipping.", MIN_REND_POST_PERIOD);