Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
100136ca
Commit
100136ca
authored
6 years ago
by
rl1987
Browse files
Options
Downloads
Patches
Plain Diff
Create new periodic event for pruning old info about Tor routers
parent
e27dff08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug27929
+5
-0
5 additions, 0 deletions
changes/bug27929
src/core/mainloop/mainloop.c
+26
-6
26 additions, 6 deletions
src/core/mainloop/mainloop.c
with
31 additions
and
6 deletions
changes/bug27929
0 → 100644
+
5
−
0
View file @
100136ca
o Minor bugfixes (periodic events):
- Refrain from calling routerlist_remove_old_routers() from
check_descriptor_callback(). Instead, create a new periodic
event that will run every minute even if Tor is not configured
as onion router. Fixes bug 27929; bugfix on 0.2.8.1-alpha.
This diff is collapsed.
Click to expand it.
src/core/mainloop/mainloop.c
+
26
−
6
View file @
100136ca
...
...
@@ -1359,6 +1359,7 @@ CALLBACK(heartbeat);
CALLBACK
(
hs_service
);
CALLBACK
(
launch_descriptor_fetches
);
CALLBACK
(
launch_reachability_tests
);
CALLBACK
(
prune_old_routers
);
CALLBACK
(
reachability_warnings
);
CALLBACK
(
record_bridge_stats
);
CALLBACK
(
rend_cache_failure_clean
);
...
...
@@ -1391,6 +1392,8 @@ STATIC periodic_event_item_t periodic_events[] = {
CALLBACK
(
retry_listeners
,
PERIODIC_EVENT_ROLE_ALL
,
PERIODIC_EVENT_FLAG_NEED_NET
),
CALLBACK
(
save_state
,
PERIODIC_EVENT_ROLE_ALL
,
0
),
CALLBACK
(
prune_old_routers
,
PERIODIC_EVENT_ROLE_ALL
,
PERIODIC_EVENT_FLAG_NEED_NET
),
CALLBACK
(
rotate_x509_certificate
,
PERIODIC_EVENT_ROLE_ALL
,
0
),
CALLBACK
(
write_stats_file
,
PERIODIC_EVENT_ROLE_ALL
,
0
),
...
...
@@ -1454,6 +1457,7 @@ static periodic_event_item_t *fetch_networkstatus_event=NULL;
static
periodic_event_item_t
*
launch_descriptor_fetches_event
=
NULL
;
static
periodic_event_item_t
*
check_dns_honesty_event
=
NULL
;
static
periodic_event_item_t
*
save_state_event
=
NULL
;
static
periodic_event_item_t
*
prune_old_routers_event
=
NULL
;
/** Reset all the periodic events so we'll do all our actions again as if we
* just started up.
...
...
@@ -1556,6 +1560,7 @@ initialize_periodic_events(void)
STMT_BEGIN name ## _event = find_periodic_event( #name ); STMT_END
NAMED_CALLBACK
(
check_descriptor
);
NAMED_CALLBACK
(
prune_old_routers
);
NAMED_CALLBACK
(
dirvote
);
NAMED_CALLBACK
(
fetch_networkstatus
);
NAMED_CALLBACK
(
launch_descriptor_fetches
);
...
...
@@ -2220,6 +2225,27 @@ retry_dns_callback(time_t now, const or_options_t *options)
return
RETRY_DNS_INTERVAL
;
}
/**
* Periodic callback: prune routerlist of old information about Tor network.
*/
static
int
prune_old_routers_callback
(
time_t
now
,
const
or_options_t
*
options
)
{
#define ROUTERLIST_PRUNING_INTERVAL (60) // 1 minute.
(
void
)
now
;
(
void
)
options
;
if
(
!
net_is_disabled
())
{
/* If any networkstatus documents are no longer recent, we need to
* update all the descriptors' running status. */
/* Remove dead routers. */
log_debug
(
LD_GENERAL
,
"Pruning routerlist..."
);
routerlist_remove_old_routers
();
}
return
ROUTERLIST_PRUNING_INTERVAL
;
}
/** Periodic callback: consider rebuilding or and re-uploading our descriptor
* (if we've passed our internal checks). */
static
int
...
...
@@ -2239,12 +2265,6 @@ check_descriptor_callback(time_t now, const or_options_t *options)
check_descriptor_ipaddress_changed
(
now
);
mark_my_descriptor_dirty_if_too_old
(
now
);
consider_publishable_server
(
0
);
/* If any networkstatus documents are no longer recent, we need to
* update all the descriptors' running status. */
/* Remove dead routers. */
/* XXXX This doesn't belong here, but it was here in the pre-
* XXXX refactoring code. */
routerlist_remove_old_routers
();
}
return
CHECK_DESCRIPTOR_INTERVAL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment