diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-12 11:02:40 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-09-12 11:03:13 -0400 |
commit | 98953b1fc29a693aa797989402f7205523448408 (patch) | |
tree | 0c3e832034461a7b8cf18e7db9569ab4020bf45a /src/or/hs_service.c | |
parent | 184bd2258673f9e33e43cfc1264da78f74ad78a4 (diff) | |
download | tor-98953b1fc29a693aa797989402f7205523448408.tar.gz tor-98953b1fc29a693aa797989402f7205523448408.zip |
hs-v3: Rate limit some log statements
Also fix an indentation issue.
Closes #23480
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r-- | src/or/hs_service.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 5759aa8127..a8883e03a0 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -2978,8 +2978,14 @@ hs_service_lists_fnames_for_sandbox(smartlist_t *file_list, void hs_service_dir_info_changed(void) { - log_info(LD_REND, "New dirinfo arrived: consider reuploading descriptor"); - consider_republishing_hs_descriptors = 1; + if (hs_service_get_num_services() > 0) { + /* New directory information usually goes every consensus so rate limit + * every 30 minutes to not be too conservative. */ + static struct ratelim_t dir_info_changed_ratelim = RATELIM_INIT(30 * 60); + log_fn_ratelim(&dir_info_changed_ratelim, LOG_INFO, LD_REND, + "New dirinfo arrived: consider reuploading descriptor"); + consider_republishing_hs_descriptors = 1; + } } /* Called when we get an INTRODUCE2 cell on the circ. Respond to the cell and |