summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-03-02 16:38:21 +1100
committerNick Mathewson <nickm@torproject.org>2017-03-04 23:22:34 -0500
commitf24638aa49bfd127c43f7ba12e91dd278b6f3264 (patch)
tree858f732899e9a6a8d586a763240276d82293a396 /src/or/rendservice.c
parent9af76a958316ce58485d12bf0e519fc79c0e4999 (diff)
downloadtor-f24638aa49bfd127c43f7ba12e91dd278b6f3264.tar.gz
tor-f24638aa49bfd127c43f7ba12e91dd278b6f3264.zip
Log a message when a hidden service has fewer intro points than expected
Closes ticket 21598.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index cb87624df5..87a9ccfaed 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