Avoid recursive call to routerlist_remove_old_routers via router_rebuild_store
Periodic functions have their log output duplicated when using adb logcat:
orbot/external/tor/src/or/periodic.c
static void periodic_event_dispatch(evutil_socket_t fd, short what, void *data) { (void)fd; (void)what; periodic_event_item_t *event = data;
time_t now = time(NULL); const or_options_t *options = get_options(); log_debug(LD_GENERAL, "Dispatching %s", event->name); int r = event->fn(now, options);
I did uncomment the above log_debug which is then printed only once as expected. The problem starts with r=events->fn(now, options);. Every function called this way seems to have its log output duplicated. I checked with builtin atomics that the function is actually called only once but the log output is duplicated, e.g.:
03-12 20:45:22.627 17948 17948 D Tor : periodic_event_dispatch(): Dispatching check_descriptor 03-12 20:45:22.637 17948 17948 I Tor : routerlist_remove_old_routers(): We have 0 live routers and 0 old router descriptors. 03-12 20:45:22.637 17948 17948 I Tor : routerlist_remove_old_routers(): We have 0 live routers and 0 old router descriptors.
This is somewhat irritating when tracing the flow of events.
Trac:
Username: anstein