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
f70fa67d
Commit
f70fa67d
authored
6 years ago
by
Nick Mathewson
Committed by
David Goulet
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
main: Use rescan_periodic_events in initialize_periodic_events_cb
parent
4e85f17e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/main.c
+4
-10
4 additions, 10 deletions
src/or/main.c
with
4 additions
and
10 deletions
src/or/main.c
+
4
−
10
View file @
f70fa67d
...
@@ -150,6 +150,7 @@ static int run_main_loop_until_done(void);
...
@@ -150,6 +150,7 @@ static int run_main_loop_until_done(void);
static
void
process_signal
(
int
sig
);
static
void
process_signal
(
int
sig
);
static
void
shutdown_did_not_work_callback
(
evutil_socket_t
fd
,
short
event
,
static
void
shutdown_did_not_work_callback
(
evutil_socket_t
fd
,
short
event
,
void
*
arg
)
ATTR_NORETURN
;
void
*
arg
)
ATTR_NORETURN
;
static
void
rescan_periodic_events
(
const
or_options_t
*
options
);
/********* START VARIABLES **********/
/********* START VARIABLES **********/
...
@@ -1478,18 +1479,9 @@ initialize_periodic_events_cb(evutil_socket_t fd, short events, void *data)
...
@@ -1478,18 +1479,9 @@ initialize_periodic_events_cb(evutil_socket_t fd, short events, void *data)
(
void
)
events
;
(
void
)
events
;
(
void
)
data
;
(
void
)
data
;
int
roles
=
get_my_roles
(
get_options
());
tor_event_free
(
initialize_periodic_events_event
);
tor_event_free
(
initialize_periodic_events_event
);
for
(
int
i
=
0
;
periodic_events
[
i
].
name
;
++
i
)
{
rescan_periodic_events
(
get_options
());
periodic_event_item_t
*
item
=
&
periodic_events
[
i
];
if
(
item
->
roles
&
roles
)
{
/* This is safe to be called on an already enabled event. */
periodic_event_enable
(
item
);
log_debug
(
LD_GENERAL
,
"Launching periodic event %s"
,
item
->
name
);
}
}
}
}
/** Set up all the members of periodic_events[], and configure them all to be
/** Set up all the members of periodic_events[], and configure them all to be
...
@@ -1546,8 +1538,10 @@ rescan_periodic_events(const or_options_t *options)
...
@@ -1546,8 +1538,10 @@ rescan_periodic_events(const or_options_t *options)
/* Enable the event if needed. It is safe to enable an event that was
/* Enable the event if needed. It is safe to enable an event that was
* already enabled. Same goes for disabling it. */
* already enabled. Same goes for disabling it. */
if
(
item
->
roles
&
roles
)
{
if
(
item
->
roles
&
roles
)
{
log_debug
(
LD_GENERAL
,
"Launching periodic event %s"
,
item
->
name
);
periodic_event_enable
(
item
);
periodic_event_enable
(
item
);
}
else
{
}
else
{
log_debug
(
LD_GENERAL
,
"Disabling periodic event %s"
,
item
->
name
);
periodic_event_disable
(
item
);
periodic_event_disable
(
item
);
}
}
}
}
...
...
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