diff options
author | David Goulet <dgoulet@torproject.org> | 2021-10-14 09:56:10 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-10-19 09:51:24 -0400 |
commit | 44e105c27f9ff7ce1fb62b09bac30679382c8d67 (patch) | |
tree | 81c5ea82d8918ca0f06cd1a0b7bf9d4808cc7be2 | |
parent | 18b5630a7c263711ff1f568e0347f1c66b31cda3 (diff) | |
download | tor-44e105c27f9ff7ce1fb62b09bac30679382c8d67.tar.gz tor-44e105c27f9ff7ce1fb62b09bac30679382c8d67.zip |
hs: Improve warning for bad service version
Now that we don't have version 2, it gives us:
[warn] HiddenServiceVersion must be between 3 and 3, not 2.
This commit changes it to:
[warn] HiddenServiceVersion must be 3, not 2.
Part of #40476
Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r-- | src/feature/hs/hs_config.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/feature/hs/hs_config.c b/src/feature/hs/hs_config.c index ee4499ef5b..79fadf4c0d 100644 --- a/src/feature/hs/hs_config.c +++ b/src/feature/hs/hs_config.c @@ -135,9 +135,13 @@ helper_parse_uint64(const char *opt, const char *value, uint64_t min, *ok = 0; ret = tor_parse_uint64(value, 10, min, max, ok, NULL); if (!*ok) { - log_warn(LD_CONFIG, "%s must be between %" PRIu64 " and %"PRIu64 - ", not %s.", - opt, min, max, value); + if (min == max) { + log_warn(LD_CONFIG, "%s must be %" PRIu64 ", not %s.", opt, max, value); + } else { + log_warn(LD_CONFIG, "%s must be between %" PRIu64 " and %"PRIu64 + ", not %s.", + opt, min, max, value); + } goto err; } log_info(LD_CONFIG, "%s was parsed to %" PRIu64, opt, ret); |