summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-03-04 23:22:46 -0500
committerNick Mathewson <nickm@torproject.org>2017-03-04 23:22:46 -0500
commit00d1093daf692b70d21d60f3333296097a01a376 (patch)
tree1a8b2868d08bb91a1a679f49ff016d0621e53d87
parent958ec0f5f877b84d8519102cc0b5b55583a15144 (diff)
parentf24638aa49bfd127c43f7ba12e91dd278b6f3264 (diff)
downloadtor-00d1093daf692b70d21d60f3333296097a01a376.tar.gz
tor-00d1093daf692b70d21d60f3333296097a01a376.zip
Merge branch 'feature21598_squashed'
-rw-r--r--changes/feature215984
-rw-r--r--src/or/rendservice.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/changes/feature21598 b/changes/feature21598
new file mode 100644
index 0000000000..317ace4bcf
--- /dev/null
+++ b/changes/feature21598
@@ -0,0 +1,4 @@
+ o Minor feature (hidden services):
+ - Log a message when a hidden service descriptor has fewer introduction
+ points than specified in HiddenServiceNumIntroductionPoints.
+ Closes ticket 21598.
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 51558990d8..82feeeb8f2 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1080,6 +1080,25 @@ rend_service_update_descriptor(rend_service_t *service)
intro_svc->time_published = time(NULL);
}
}
+
+ /* Check that we have the right number of intro points */
+ unsigned int have_intro = (unsigned int)smartlist_len(d->intro_nodes);
+ if (have_intro != service->n_intro_points_wanted) {
+ int severity;
+ /* Getting less than we wanted or more than we're allowed is serious */
+ if (have_intro < service->n_intro_points_wanted ||
+ have_intro > NUM_INTRO_POINTS_MAX) {
+ severity = LOG_WARN;
+ } else {
+ /* Getting more than we wanted is weird, but less of a problem */
+ severity = LOG_NOTICE;
+ }
+ log_fn(severity, LD_REND, "Hidden service %s wanted %d intro points, but "
+ "descriptor was updated with %d instead.",
+ service->service_id,
+ service->n_intro_points_wanted, have_intro);
+ rend_service_dump_stats(severity);
+ }
}
/* Allocate and return a string containing the path to file_name in